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

Commit

Permalink
relative_interior: Fix for dimension 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jun 6, 2021
1 parent b8bfe20 commit 6869673
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/sage/geometry/cone.py
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,7 @@ def interior_contains(self, *args):
point = point[0]
return self._contains(point, 'interior')

@cached_method
def interior(self):
r"""
Return the interior of ``self``.
Expand Down Expand Up @@ -1761,11 +1762,12 @@ def relative_interior_contains(self, *args):
point = point[0]
return self._contains(point, 'relative interior')

@cached_method
def relative_interior(self):
r"""
Return the relative interior of ``self``.
"""
if self.is_full_space():
if self.is_trivial() or self.is_full_space():
return self
return RelativeInterior(self)

Expand Down
9 changes: 8 additions & 1 deletion src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8500,8 +8500,15 @@ def relative_interior(self):
sage: (1, 0) in ri_P
False
sage: P0 = Polyhedron(vertices=[[1, 2]])
sage: P0.relative_interior() is P0
True
sage: Empty = Polyhedron(ambient_dim=2)
sage: Empty.relative_interior() is Empty
True
"""
if self.is_empty() or self.is_universe():
if self.dim() <= 0 or self.is_universe():
return self
return RelativeInterior(self)

Expand Down

0 comments on commit 6869673

Please sign in to comment.