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

Commit

Permalink
src/sage/geometry/abc.pyx: New
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Oct 17, 2021
1 parent c896669 commit 502546b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
27 changes: 27 additions & 0 deletions src/sage/geometry/abc.pyx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
r"""
Abstract base classes for classes in :mod:`~sage.geometry`
"""


class LatticePolytope:
r"""
Abstract base class for :class:`~sage.geometry.lattice_polytope.LatticePolytopeClass`
"""

pass


class ConvexRationalPolyhedralCone:
r"""
Abstract base class for :class:`~sage.geometry.cone.ConvexRationalPolyhedralCone`
"""

pass


class Polyhedron:
r"""
Abstract base class for :class:`~sage.geometry.polyhedron.base.Polyhedron_base`
"""

pass
3 changes: 2 additions & 1 deletion src/sage/geometry/cone.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
from sage.structure.richcmp import richcmp_method, richcmp
from sage.geometry.integral_points import parallelotope_points
from sage.geometry.convex_set import ConvexSet_closed
import sage.geometry.abc

from sage.misc.lazy_import import lazy_import
from sage.features import PythonModule
Expand Down Expand Up @@ -1420,7 +1421,7 @@ def classify_cone_2d(ray0, ray1, check=True):
# and ``ambient_ray_indices`` keyword parameters. See ``intersection`` method
# for an example why this is needed.
@richcmp_method
class ConvexRationalPolyhedralCone(IntegralRayCollection, Container, ConvexSet_closed):
class ConvexRationalPolyhedralCone(IntegralRayCollection, Container, ConvexSet_closed, sage.geometry.abc.ConvexRationalPolyhedralCone):
r"""
Create a convex rational polyhedral cone.
Expand Down
3 changes: 2 additions & 1 deletion src/sage/geometry/lattice_polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
from sage.structure.sage_object import SageObject
from sage.structure.richcmp import richcmp_method, richcmp
from sage.geometry.convex_set import ConvexSet_compact
import sage.geometry.abc

from copy import copy
from collections.abc import Hashable
Expand Down Expand Up @@ -469,7 +470,7 @@ def is_LatticePolytope(x):
return isinstance(x, LatticePolytopeClass)

@richcmp_method
class LatticePolytopeClass(ConvexSet_compact, Hashable):
class LatticePolytopeClass(ConvexSet_compact, Hashable, sage.geometry.abc.LatticePolytope):
r"""
Create a lattice polytope.
Expand Down
3 changes: 2 additions & 1 deletion src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
from sage.graphs.graph import Graph
from sage.geometry.convex_set import ConvexSet_closed, AffineHullProjectionData

import sage.geometry.abc
from .constructor import Polyhedron
from sage.geometry.relative_interior import RelativeInterior
from sage.categories.sets_cat import EmptySetError
Expand Down Expand Up @@ -100,7 +101,7 @@ def is_Polyhedron(X):


#########################################################################
class Polyhedron_base(Element, ConvexSet_closed):
class Polyhedron_base(Element, ConvexSet_closed, sage.geometry.abc.Polyhedron):
"""
Base class for Polyhedron objects
Expand Down

0 comments on commit 502546b

Please sign in to comment.