Skip to content

Commit

Permalink
Trac #18861: Three apparently useless polyhedron methods
Browse files Browse the repository at this point in the history
It seems that the three following functions are not used anywhere

{{{
(polgraph|✚2…)~/sage/geometry$ grep _make_polyh . -R
./polyhedron/base.py:#    _make_polyhedron_face.
./polyhedron/base.py:    def _make_polyhedron_face(self, Vindices,
Hindices):
./polyhedron/base.py:            sage:
square._make_polyhedron_face((0,2), (1,))
./polyhedron/base.py:            return
self._make_polyhedron_face(Vindices, Hindices)
(polgraph|✚2…)~/sage/geometry$ grep _init_fac . -R
./polyhedron/base.py:#    _init_facet_adjacency_matrix,
_init_vertex_adjacency_matrix, and
./polyhedron/backend_cdd.py:    def _init_facet_adjacency_matrix(self,
verbose=False):
./polyhedron/backend_cdd.py:            sage:
p._init_facet_adjacency_matrix()
(polgraph|✚2…)~/sage/geometry$ grep _init_vertex . -R
./polyhedron/base.py:#    _init_facet_adjacency_matrix,
_init_vertex_adjacency_matrix, and
./polyhedron/backend_cdd.py:    def _init_vertex_adjacency_matrix(self,
verbose=False):
./polyhedron/backend_cdd.py:            sage:
p._init_vertex_adjacency_matrix()
}}}

Should they be removed, or used somewhere?

Nathann

URL: https://trac.sagemath.org/18861
Reported by: ncohen
Ticket author(s): Jean-Philippe Labbé
Reviewer(s): Frédéric Chapoton
  • Loading branch information
Release Manager committed Oct 28, 2019
2 parents 6e22a72 + 9f7a12b commit ae14d8e
Showing 1 changed file with 4 additions and 31 deletions.
35 changes: 4 additions & 31 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
# * you must implement _init_from_Vrepresentation and
# _init_from_Hrepresentation
#
# * You might want to override _init_empty_polyhedron and
# _make_polyhedron_face.
# * You might want to override _init_empty_polyhedron
#
# * You can of course also override any other method for which you
# have a faster implementation.
Expand Down Expand Up @@ -5173,33 +5172,6 @@ def barycentric_subdivision(self, subdivision_frac=None):
else:
return (polar.polar()) + barycenter

def _make_polyhedron_face(self, Vindices, Hindices):
"""
Construct a face of the polyhedron.
INPUT:
- ``Vindices`` -- a tuple of integers. The indices of the
V-representation objects that span the face.
- ``Hindices`` -- a tuple of integers. The indices of the
H-representation objects that hold as equalities on the
face.
OUTPUT:
A new :class:`~sage.geometry.polyhedron.face.PolyhedronFace` instance. It is not checked
whether the input data actually defines a face.
EXAMPLES::
sage: square = polytopes.hypercube(2)
sage: square._make_polyhedron_face((0,2), (1,)).ambient_V_indices()
(0, 2)
"""
from sage.geometry.polyhedron.face import PolyhedronFace
return PolyhedronFace(self, Vindices, Hindices)

@cached_method
def face_lattice(self):
"""
Expand Down Expand Up @@ -5357,12 +5329,13 @@ def face_lattice(self):
lines = [ l.index() for l in self.line_generator() ]

def face_constructor(atoms, coatoms):
if len(atoms) == 0:
from sage.geometry.polyhedron.face import PolyhedronFace
if not atoms:
Vindices = ()
else:
Vindices = tuple(sorted([ atom_to_Vindex[i] for i in atoms ]+lines))
Hindices = tuple(sorted([ coatom_to_Hindex[i] for i in coatoms ]+equations))
return self._make_polyhedron_face(Vindices, Hindices)
return PolyhedronFace(self,Vindices, Hindices)

from sage.geometry.hasse_diagram import lattice_from_incidences
return lattice_from_incidences(atoms_incidences, coatoms_incidences,
Expand Down

0 comments on commit ae14d8e

Please sign in to comment.