Skip to content

Commit

Permalink
Trac #30445: Merge duplications in edges, ridges and f-vector of comb…
Browse files Browse the repository at this point in the history
…inatorial polyhedron

We merge some duplications of obtaining edges, ridges and f-vector.

There was an entire copy of getting edges/ridges that also obtained the
f-vector. But it is much simpler doing this directly in the f-vector
code.

Also getting the edges/ridges is almost the same thing. We can let the
`FaceIterator` worry about the details.

URL: https://trac.sagemath.org/30445
Reported by: gh-kliem
Ticket author(s): Jonathan Kliem
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager committed Jan 10, 2021
2 parents 60e3d32 + 62b3d9f commit bc8d728
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 219 deletions.
13 changes: 10 additions & 3 deletions src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,16 @@ cdef class CombinatorialPolyhedron(SageObject):
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_f_vector(self, bint compute_edges=*, given_dual=*) except -1

cdef inline int _compute_edges(self, dual) except -1:
return self._compute_edges_or_ridges(dual, True)

cdef inline int _compute_ridges(self, dual) except -1:
return self._compute_edges_or_ridges(dual, False)

cdef int _compute_edges_or_ridges(self, bint dual, bint do_edges) except -1
cdef size_t _compute_edges_or_ridges_with_iterator(self, FaceIterator face_iter, bint do_atom_rep, size_t ***edges_pt, size_t *counter_pt, size_t *current_length_pt, MemoryAllocator mem) except -1
cdef int _compute_face_lattice_incidences(self) except -1

cdef inline int _set_edge(self, size_t a, size_t b, size_t ***edges_pt, size_t *counter_pt, size_t *current_length_pt, MemoryAllocator mem) except -1
Expand Down
Loading

0 comments on commit bc8d728

Please sign in to comment.