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

Commit

Permalink
added combinatorial polyhedron as an attribute for polyhedra
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Kliem committed Oct 18, 2019
1 parent 0f20b37 commit b89610e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ List of Polyhedron methods
:widths: 30, 70
:delim: |

:meth:`~sage.geometry.polyhedron.base.Polyhedron_base.combinatorial_polyhedron` | the combinatorial polyhedron
:meth:`~sage.geometry.polyhedron.base.Polyhedron_base.face_lattice` | the face lattice
:meth:`~sage.geometry.polyhedron.base.Polyhedron_base.combinatorial_automorphism_group` | the automorphism group of the underlying combinatorial polytope
:meth:`~sage.geometry.polyhedron.base.Polyhedron_base.graph`, :meth:`~sage.geometry.polyhedron.base.Polyhedron_base.vertex_graph` | underlying graph
Expand Down
21 changes: 21 additions & 0 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2731,6 +2731,27 @@ def is_compact(self):
"""
return self.n_rays() == 0 and self.n_lines() == 0

@cached_method
def combinatorial_polyhedron(self):
r"""
Return the combinatorial type of ``self``.
See :class:`sage.geometry.polyhedron.combinatorial_polyhedron.base.CombinatorialPolyhedron`.
EXAMPLES::
sage: polytopes.cube().combinatorial_polyhedron()
A 3-dimensional combinatorial polyhedron with 6 facets
sage: polytopes.cyclic_polytope(4,10).combinatorial_polyhedron()
A 4-dimensional combinatorial polyhedron with 35 facets
sage: Polyhedron(rays=[[0,1], [1,0]]).combinatorial_polyhedron()
A 2-dimensional combinatorial polyhedron with 2 facets
"""
from sage.geometry.polyhedron.combinatorial_polyhedron.base import CombinatorialPolyhedron
return CombinatorialPolyhedron(self)

def is_simple(self):
"""
Test for simplicity of a polytope.
Expand Down

0 comments on commit b89610e

Please sign in to comment.