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

Commit

Permalink
deprecation warnings; n_Vrepresentation -> n_ambient_Vrepresentation …
Browse files Browse the repository at this point in the history
…in CombinatorialFace
  • Loading branch information
Jonathan Kliem committed Nov 18, 2019
1 parent 7acef4c commit ade3dca
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Combinatorial face of a polyhedron
This module provides the combinatorial type of a polyhedral face.
,, SEEALSO::
.. SEEALSO::
:mod:`sage.geometry.polyhedron.combinatorial_polyhedron.base`,
:mod:`sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator`.
Expand Down Expand Up @@ -133,7 +133,7 @@ cdef class CombinatorialFace(SageObject):
An inequality (-210, 317, -125, 19, -1) x + 0 >= 0)
sage: face.Hrepr(names=False)
(3, 4, 5, 6, 7, 8, 9, 10, 11, 18, 19)
sage: face.n_Hrepresentation()
sage: face.n_ambient_Hrepresentation()
11
"""
def __init__(self, data, dimension=None, index=None):
Expand Down Expand Up @@ -400,6 +400,26 @@ cdef class CombinatorialFace(SageObject):
else:
return smallInteger(self.n_atom_rep())

def n_Vrepr(self):
r"""
.. SEEALSO::
:meth:`CombinatorialFace.n_ambient_Vrepresentation`
TESTS::
sage: P = polytopes.cube()
sage: C = CombinatorialPolyhedron(P)
sage: it = C.face_iter()
sage: face = next(it)
sage: _ = face.n_Vrepr()
doctest:...: DeprecationWarning: the method n_Vrepr of CombinatorialFace is deprecated
See https://trac.sagemath.org/28614 for details.
"""
from sage.misc.superseded import deprecation
deprecation(28614, "the method n_Vrepr of CombinatorialFace is deprecated")
return self.n_ambient_Vrepresentation()

def Hrepr(self, names=True):
r"""
Return the Hrepresentation of the face.
Expand Down Expand Up @@ -488,7 +508,7 @@ cdef class CombinatorialFace(SageObject):
return tuple(smallInteger(self.atom_repr[i])
for i in range(length))

def n_Hrepresentation(self):
def n_ambient_Hrepresentation(self):
r"""
Returns the length of the :meth:`Hrepr`.
Expand All @@ -499,14 +519,34 @@ cdef class CombinatorialFace(SageObject):
sage: P = polytopes.cube()
sage: C = CombinatorialPolyhedron(P)
sage: it = C.face_iter()
sage: all(face.n_Hrepresentation() == len(face.Hrepr()) for face in it)
sage: all(face.n_ambient_Hrepresentation() == len(face.Hrepr()) for face in it)
True
"""
if not self._dual:
return smallInteger(self.set_coatom_repr())
else:
return smallInteger(self.n_atom_rep())

def n_Hrepr(self):
r"""
.. SEEALSO::
:meth:`CombinatorialFace.n_ambient_Hrepresentation`
TESTS::
sage: P = polytopes.cube()
sage: C = CombinatorialPolyhedron(P)
sage: it = C.face_iter()
sage: face = next(it)
sage: _ = face.n_Hrepr()
doctest:...: DeprecationWarning: the method n_Hrepr of CombinatorialFace is deprecated
See https://trac.sagemath.org/28614 for details.
"""
from sage.misc.superseded import deprecation
deprecation(28614, "the method n_Hrepr of CombinatorialFace is deprecated")
return self.n_ambient_Hrepresentation()

cdef size_t n_atom_rep(self) except -1:
r"""
Compute the number of atoms in the current face by counting the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Obtain the facet-representation::
An inequality (-1, 1, 1) x + 1 >= 0)
sage: face.Hrepr(names=False)
(4, 5, 6, 7)
sage: face.n_Hrepresentation()
sage: face.n_ambient_Hrepresentation()
4
In non-dual mode one can ignore all faces contained in the current face::
Expand Down Expand Up @@ -641,7 +641,7 @@ cdef class FaceIterator(SageObject):
sage: it = C.face_iter(dual=True)
sage: n_faces_with_non_simplex_quotient = 1
sage: for face in it:
....: if face.n_Hrepresentation() > C.dimension() - face.dimension() + 1:
....: if face.n_ambient_Hrepresentation() > C.dimension() - face.dimension() + 1:
....: n_faces_with_non_simplex_quotient += 1
....: else:
....: it.ignore_supfaces()
Expand Down

0 comments on commit ade3dca

Please sign in to comment.