Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jul 27, 2023
1 parent e11afa7 commit 526efac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
9 changes: 4 additions & 5 deletions src/sage/groups/perm_gps/partn_ref/data_structures.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ cdef int PS_first_smallest(PartitionStack *PS, bitset_t b, int *second_pos=NULL)
"""
cdef int i = 0, j = 0, location = 0, n = PS.degree
bitset_zero(b)
while 1:
while True:
if PS.levels[i] <= PS.depth:
if i != j and n > i - j + 1:
n = i - j + 1
Expand All @@ -304,19 +304,18 @@ cdef int PS_first_smallest(PartitionStack *PS, bitset_t b, int *second_pos=NULL)
# location now points to the beginning of the first, smallest,
# nontrivial cell
i = location
while 1:
while True:
bitset_flip(b, PS.entries[i])
if PS.levels[i] <= PS.depth:
break
i += 1

if second_pos != NULL:
if n==2:
second_pos[0] = PS.entries[location+1]
if n == 2:
second_pos[0] = PS.entries[location + 1]
else:
second_pos[0] = -1


return PS.entries[location]


Expand Down
14 changes: 8 additions & 6 deletions src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -953,26 +953,28 @@ cdef int PS_first_smallest_PR(PartitionStack *PS, bitset_t b, int *second_pos=NU
"""
cdef int i = 0, j = 0, location = 0, n = PS.degree
bitset_zero(b)
while 1:
while True:
if PS.levels[i] <= PS.depth:
if i != j and n > i - j + 1 and (partn_ref_alg is None or
partn_ref_alg._minimization_allowed_on_col(PS.entries[j])):
n = i - j + 1
location = j
j = i + 1
if PS.levels[i] == -1: break
if PS.levels[i] == -1:
break
i += 1
# location now points to the beginning of the first, smallest,
# nontrivial cell
i = location
while 1:
while True:
bitset_flip(b, PS.entries[i])
if PS.levels[i] <= PS.depth: break
if PS.levels[i] <= PS.depth:
break
i += 1

if second_pos != NULL:
if n==2:
second_pos[0] = PS.entries[location+1]
if n == 2:
second_pos[0] = PS.entries[location + 1]
else:
second_pos[0] = -1

Expand Down

0 comments on commit 526efac

Please sign in to comment.