@@ -1461,18 +1461,15 @@ cdef class CombinatorialPolyhedron(SageObject):
1461
1461
cdef pair_s ridge
1462
1462
1463
1463
if add_equations and names:
1464
- def get_ridge (size_t i ):
1465
- ridge = self ._ridges.get(i)[0 ]
1466
- return ((f(ridge.first),) + self .equations(),
1467
- (f(ridge.second),) + self .equations())
1468
-
1464
+ return tuple (
1465
+ ((f(self ._ridges.get(i)[0 ].first),) + self .equations(),
1466
+ (f(self ._ridges.get(i)[0 ].second),) + self .equations())
1467
+ for i in range (n_ridges))
1469
1468
else :
1470
- def get_ridge (size_t i ):
1471
- ridge = self ._ridges.get(i)[0 ]
1472
- return (f(ridge.first), f(ridge.second))
1473
-
1474
- cdef size_t j
1475
- return tuple (get_ridge(j) for j in range (n_ridges))
1469
+ return tuple (
1470
+ (f(self ._ridges.get(i)[0 ].first),
1471
+ f(self ._ridges.get(i)[0 ].second))
1472
+ for i in range (n_ridges))
1476
1473
1477
1474
@cached_method
1478
1475
def facet_adjacency_matrix (self , algorithm = None ):
@@ -2110,7 +2107,7 @@ cdef class CombinatorialPolyhedron(SageObject):
2110
2107
# For each face in the iterator, check if its a simplex.
2111
2108
face_iter.structure.lowest_dimension = 2 # every 1-face is a simplex
2112
2109
d = face_iter.next_dimension()
2113
- while ( d < dim) :
2110
+ while d < dim:
2114
2111
sig_check()
2115
2112
if face_iter.n_atom_rep() == d + 1 :
2116
2113
# The current face is a simplex.
@@ -2221,7 +2218,7 @@ cdef class CombinatorialPolyhedron(SageObject):
2221
2218
# For each coface in the iterator, check if its a simplex.
2222
2219
coface_iter.structure.lowest_dimension = 2 # every coface of dimension 1 is a simplex
2223
2220
d = coface_iter.next_dimension()
2224
- while ( d < dim) :
2221
+ while d < dim:
2225
2222
sig_check()
2226
2223
if coface_iter.n_atom_rep() == d + 1 :
2227
2224
# The current coface is a simplex.
@@ -3721,13 +3718,13 @@ cdef class CombinatorialPolyhedron(SageObject):
3721
3718
3722
3719
dimension_one = 0
3723
3720
if dim > - 1 :
3724
- while ( f_vector[dimension_one + 1 ] == 0 ) :
3721
+ while f_vector[dimension_one + 1 ] == 0 :
3725
3722
# Taking care of cases, where there might be no faces
3726
3723
# of dimension 0, 1, etc (``n_lines > 0``).
3727
3724
dimension_one += 1
3728
3725
dimension_two = - 1
3729
3726
3730
- while ( dimension_one < dim + 1 ) :
3727
+ while dimension_one < dim + 1 :
3731
3728
already_seen = sum (f_vector[j] for j in range (dimension_two + 1 ))
3732
3729
already_seen_next = already_seen + f_vector[dimension_two + 1 ]
3733
3730
0 commit comments