diff --git a/src/sage/geometry/cone.py b/src/sage/geometry/cone.py index e7813040521..a4e11c5a9d3 100644 --- a/src/sage/geometry/cone.py +++ b/src/sage/geometry/cone.py @@ -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``. @@ -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) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 1175d21925f..985a9f5c6c5 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -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)