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

Commit

Permalink
Polyhedron_base.as_manifold_subset: New
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Feb 20, 2022
1 parent a502039 commit 79ce6da
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5851,6 +5851,44 @@ def _affine_hull_name_latex_name(self, name=None, latex_name=None):
aff_latex_name = r'\mathop{\mathrm{' + operator + '}}(' + latex_name + ')'
return aff_name, aff_latex_name

def as_manifold_subset(self, name=None, latex_name=None, start_index=0, ambient_space=None,
names=None, **kwds):
"""
Return the relative interior of ``self`` as a subset of its affine hull manifold.
It is the closure of its :meth:`relative_interior_manifold` in
the :meth:`affine_hull_manifold`.
EXAMPLES::
sage: cube = polytopes.cube(); cube
A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 8 vertices
sage: cube.as_manifold_subset()
Topological closure P of the
Open subset int_P of the
Euclidean space E^3
sage: triangle = Polyhedron([(1,0,0), (0,1,0), (0,0,1)]); triangle
A 2-dimensional polyhedron in ZZ^3 defined as the convex hull of 3 vertices
sage: triangle.as_manifold_subset()
Topological closure P of the
Open subset ri_P of the
2-dimensional Riemannian submanifold aff_P
embedded in the Euclidean space E^3
"""
if name is None:
name = 'P'
if latex_name is None:
latex_name = name
relint_name, relint_latex_name = self._relative_interior_name_latex_name(name, latex_name)
relint_self = self.relative_interior_manifold(name=relint_name,
latex_name=relint_latex_name,
start_index=start_index,
ambient_space=ambient_space,
names=names,
**kwds)
return relint_self.closure(name=name, latex_name=latex_name)

def _relative_interior_name_latex_name(self, name=None, latex_name=None):
"""
Return the default name of a relative interior.
Expand Down

0 comments on commit 79ce6da

Please sign in to comment.