-
-
Notifications
You must be signed in to change notification settings - Fork 405
/
base.pxd
63 lines (56 loc) · 3.12 KB
/
base.pxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
cimport cython
from libc.stdint cimport uint64_t
from sage.ext.memory_allocator cimport MemoryAllocator
from sage.structure.sage_object cimport SageObject
from .face_iterator cimport FaceIterator, CombinatorialFace
from .list_of_faces cimport ListOfFaces
from .polyhedron_face_lattice cimport PolyhedronFaceLattice
@cython.final
cdef class CombinatorialPolyhedron(SageObject):
# Do not assume any of those attributes to be initialized, use the corresponding methods instead.
cdef tuple _V # the names of VRep, if they exist
cdef tuple _H # the names of HRep, if they exist
cdef tuple _equalities # stores equalities, given on input (might belong to Hrep)
cdef int _dimension # stores dimension, -2 on init
cdef unsigned int _length_Hrepr # Hrepr might include equalities
cdef unsigned int _length_Vrepr # Vrepr might include rays/lines
cdef size_t _n_facets # length Hrep without equalities
cdef bint _unbounded # ``True`` iff Polyhedron is unbounded
cdef ListOfFaces _bitrep_facets # facets in bit representation
cdef ListOfFaces _bitrep_Vrepr # vertices in bit representation
cdef ListOfFaces _far_face # a 'face' containing all none-vertices of Vrepr
cdef tuple _far_face_tuple
cdef tuple _f_vector
# Edges, ridges and incidences are stored in a pointer of pointers.
# The first edge has vertices ``edges[0][0]`` and ``edges[0][1]``,
# the second edge has vertices ``edges[0][2]`` and ``edges[0][3]``, etc.
# There are ``_length_edges_list`` edges in ``edges[i]``, so the edge
# ``_length_edges_list + 1`` has vertices ``edges[1][0]`` and ``edges[1][1]``.
# Likewise for ridges and incidences.
cdef size_t _length_edges_list
cdef size_t **_edges # stores edges labeled by vertex indices
cdef size_t _n_edges
cdef size_t **_ridges # stores ridges labeled by facet indices
cdef size_t _n_ridges
cdef size_t **_face_lattice_incidences # stores incidences in Hasse diagram labeled indices of the faces
cdef size_t _n_face_lattice_incidences
cdef PolyhedronFaceLattice _all_faces # class to generate Hasse diagram incidences
cdef tuple V(self)
cdef tuple H(self)
cdef tuple equalities(self)
cdef unsigned int length_Vrepr(self)
cdef unsigned int length_Hrepr(self)
cdef bint unbounded(self)
cdef ListOfFaces bitrep_facets(self)
cdef ListOfFaces bitrep_Vrepr(self)
cdef ListOfFaces far_face(self)
cdef tuple far_face_tuple(self)
# Space for edges, ridges, etc. is allocated with ``MemoryAllocators``.
# Upon success they are copied to ``_mem_tuple``.
# Thus deallocation (at the correct time) is taken care of.
cdef tuple _mem_tuple
cdef FaceIterator _face_iter(self, bint dual, int dimension)
cdef int _compute_f_vector(self) except -1
cdef int _compute_edges(self, dual) except -1
cdef int _compute_ridges(self, dual) except -1
cdef int _compute_face_lattice_incidences(self) except -1