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

Commit

Permalink
ConvexSet_base.cartesian_product: New
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jun 11, 2021
1 parent 17467c4 commit fa5dc6e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
29 changes: 23 additions & 6 deletions src/sage/geometry/convex_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,6 @@ def relative_interior(self):
return self
raise NotImplementedError

@abstract_method(optional=True)
def affine_hull(self):
r"""
Return the affine hull of ``self``.
"""

def _test_convex_set(self, tester=None, **options):
"""
Run some tests on the methods of :class:`ConvexSet_base`.
Expand Down Expand Up @@ -346,6 +340,29 @@ def _test_convex_set(self, tester=None, **options):
if self.is_compact():
tester.assertTrue(self.is_closed())

# Optional methods

@abstract_method(optional=True)
def affine_hull(self):
r"""
Return the affine hull of ``self``.
"""

@abstract_method(optional=True)
def cartesian_product(self, other):
"""
Return the Cartesian product.
INPUT:
- ``other`` -- another convex set
OUTPUT:
The Cartesian product of ``self`` and ``other``.
"""


class ConvexSet_closed(ConvexSet_base):
r"""
Abstract base class for closed convex sets.
Expand Down
2 changes: 2 additions & 0 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4817,6 +4817,8 @@ def product(self, other):

_mul_ = product

cartesian_product = product

def _test_product(self, tester=None, **options):
"""
Run tests on the method :meth:`.product`.
Expand Down

0 comments on commit fa5dc6e

Please sign in to comment.