Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'public/29898' of git://trac.sagemath.org/sage into publ…
Browse files Browse the repository at this point in the history
…ic/29918
  • Loading branch information
Jonathan Kliem committed Jun 20, 2020
2 parents 5d79b2b + d7cca49 commit d62124f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,37 @@ cdef class CombinatorialPolyhedron(SageObject):
sage: C.vertex_facet_graph(names=False).vertices()
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
TESTS:
Test that :trac:`29898` is fixed::
sage: Polyhedron().vertex_facet_graph()
Digraph on 0 vertices
sage: Polyhedron([[0]]).vertex_facet_graph()
Digraph on 2 vertices
sage: Polyhedron([[0]]).vertex_facet_graph(False)
Digraph on 2 vertices
"""
if self.dimension() == -1:
return DiGraph()
if self.dimension() == 0:
if not names:
return DiGraph([(0,1)])
else:
Vrep = self.Vrep()
if Vrep:
v = Vrep[0]
else:
v = ("V", 0)

facet_names = self.facet_names()
if facet_names:
f = facet_names[0]
else:
f = ("H", 0)
return DiGraph([(v, f)])

# The face iterator will iterate through the facets in opposite order.
facet_iter = self.face_iter(self.dimension() - 1, dual=False)
n_facets = self.n_facets()
Expand Down

0 comments on commit d62124f

Please sign in to comment.