Skip to content

Commit 1ef47d1

Browse files
committed
refactor: BinaryList -> ListOfPairs
1 parent 2f2732e commit 1ef47d1

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

src/sage/data_structures/binary_list.pxd renamed to src/sage/data_structures/list_of_pairs.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cdef struct pair_s:
55
size_t second
66

77
@cython.final
8-
cdef class BinaryList:
8+
cdef class ListOfPairs:
99
cdef pair_s** _lists
1010
cdef size_t length
1111

src/sage/data_structures/binary_list.pyx renamed to src/sage/data_structures/list_of_pairs.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ from sage.rings.integer cimport smallInteger
1919
# Should be neither exposed nor modified.
2020
cdef size_t length_per_list = 16348
2121

22-
cdef class BinaryList:
22+
cdef class ListOfPairs:
2323
def __dealloc__(self):
2424
cdef size_t n_lists = self.length // length_per_list
2525
cdef size_t i
@@ -55,8 +55,8 @@ cdef class BinaryList:
5555
5656
EXAMPLES::
5757
58-
sage: from sage.data_structures.binary_list import BinaryList
59-
sage: l = BinaryList()
58+
sage: from sage.data_structures.list_of_pairs import ListOfPairs
59+
sage: l = ListOfPairs()
6060
sage: l[0] = [1, 5]
6161
sage: l[0]
6262
(1, 5)
@@ -80,8 +80,8 @@ cdef class BinaryList:
8080
8181
EXAMPLES::
8282
83-
sage: from sage.data_structures.binary_list import BinaryList
84-
sage: l = BinaryList()
83+
sage: from sage.data_structures.list_of_pairs import ListOfPairs
84+
sage: l = ListOfPairs()
8585
sage: l[0] = (2, 1)
8686
sage: l[1] = (1, 2)
8787
sage: l[0]

src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pxd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
cimport cython
2-
from sage.data_structures.binary_list cimport BinaryList
3-
from sage.structure.sage_object cimport SageObject
4-
from .face_iterator cimport FaceIterator, CombinatorialFace
5-
from .list_of_faces cimport ListOfFaces
6-
from .face_data_structure cimport face_t
7-
from .polyhedron_face_lattice cimport PolyhedronFaceLattice
2+
from sage.data_structures.list_of_pairs cimport ListOfPairs
3+
from sage.structure.sage_object cimport SageObject
4+
from .face_iterator cimport FaceIterator, CombinatorialFace
5+
from .list_of_faces cimport ListOfFaces
6+
from .face_data_structure cimport face_t
7+
from .polyhedron_face_lattice cimport PolyhedronFaceLattice
88

99
@cython.final
1010
cdef class CombinatorialPolyhedron(SageObject):
@@ -25,9 +25,9 @@ cdef class CombinatorialPolyhedron(SageObject):
2525
cdef tuple _far_face_tuple
2626
cdef tuple _f_vector
2727

28-
cdef BinaryList _edges # stores edges labeled by vertex indices
29-
cdef BinaryList _ridges # stores ridges labeled by facet indices
30-
cdef BinaryList _face_lattice_incidences # stores incidences in Hasse diagram labeled indices of the faces
28+
cdef ListOfPairs _edges # stores edges labeled by vertex indices
29+
cdef ListOfPairs _ridges # stores ridges labeled by facet indices
30+
cdef ListOfPairs _face_lattice_incidences # stores incidences in Hasse diagram labeled indices of the faces
3131
cdef PolyhedronFaceLattice _all_faces # class to generate Hasse diagram incidences
3232

3333
cdef tuple Vrep(self)
@@ -58,6 +58,6 @@ cdef class CombinatorialPolyhedron(SageObject):
5858
cdef int _compute_edges_or_ridges(self, int dual, bint do_edges) except -1
5959
cdef size_t _compute_edges_or_ridges_with_iterator(
6060
self, FaceIterator face_iter, const bint do_atom_rep, const bint do_f_vector,
61-
BinaryList edges, size_t* f_vector) except -1
61+
ListOfPairs edges, size_t* f_vector) except -1
6262

6363
cdef int _compute_face_lattice_incidences(self) except -1

src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ from .conversions \
102102
from .conversions cimport Vrep_list_to_bit_rep
103103
from sage.misc.cachefunc import cached_method
104104

105-
from sage.data_structures.binary_list cimport pair_s
106-
from sage.rings.integer cimport smallInteger
107-
from cysignals.signals cimport sig_check
105+
from sage.data_structures.list_of_pairs cimport pair_s
106+
from sage.rings.integer cimport smallInteger
107+
from cysignals.signals cimport sig_check
108108

109109
from .face_data_structure cimport face_len_atoms, face_init, face_free
110110
from .face_iterator cimport iter_t, parallel_f_vector
@@ -3575,7 +3575,7 @@ cdef class CombinatorialPolyhedron(SageObject):
35753575
cdef FaceIterator face_iter
35763576
cdef int dim = self.dimension()
35773577

3578-
cdef BinaryList edges = BinaryList()
3578+
cdef ListOfPairs edges = ListOfPairs()
35793579
cdef int output_dim_init = 1 if do_edges else dim - 2
35803580

35813581
cdef bint do_f_vector = False
@@ -3644,7 +3644,7 @@ cdef class CombinatorialPolyhedron(SageObject):
36443644

36453645
cdef size_t _compute_edges_or_ridges_with_iterator(
36463646
self, FaceIterator face_iter, const bint do_atom_rep, const bint do_f_vector,
3647-
BinaryList edges, size_t* f_vector) except -1:
3647+
ListOfPairs edges, size_t* f_vector) except -1:
36483648
r"""
36493649
See :meth:`CombinatorialPolyhedron._compute_edges`.
36503650
"""
@@ -3714,7 +3714,7 @@ cdef class CombinatorialPolyhedron(SageObject):
37143714
# For ``dimension_one`` we add:
37153715
cdef size_t already_seen_next # = sum(f_vector[j] for j in range(dimension_two + 2))
37163716

3717-
cdef BinaryList incidences = BinaryList()
3717+
cdef ListOfPairs incidences = ListOfPairs()
37183718

37193719
if all_faces is None:
37203720
raise ValueError("could not determine a list of all faces")

0 commit comments

Comments
 (0)