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

Commit

Permalink
give doctests that f_vector for unbounded polyhedra works now
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Kliem committed Oct 18, 2019
1 parent bf85a62 commit 3c9085e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
21 changes: 19 additions & 2 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5336,15 +5336,32 @@ def f_vector(self):
OUTPUT:
Returns a vector whose ``i``-th entry is the number of
``i``-dimensional faces of the polytope.
Returns a vector whose `i`-th entry is the number of
`i-2`-dimensional faces of the polytope.
Note that the ``vertices`` as given by :meth:`Polyhedron_base.vertices`
do not need to correspond to `0`-dimensional faces. If a polyhedron
contains `k` lines they correspond to `k`-dimensional faces.
EXAMPLES::
sage: p = Polyhedron(vertices=[[1, 2, 3], [1, 3, 2],
....: [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1], [0, 0, 0]])
sage: p.f_vector()
(1, 7, 12, 7, 1)
sage: polytopes.cyclic_polytope(4,10).f_vector()
(1, 10, 45, 70, 35, 1)
sage: polytopes.hypercube(5).f_vector()
(1, 32, 80, 80, 40, 10, 1)
Polyhedra with lines do not have `0`-faces::
sage: Polyhedron(ieqs=[[1,-1,0],[1,1,0]]).f_vector()
(1, 0, 2, 1)
sage: Polyhedron(ieqs=[[1,-1,0,0],[1,1,0,0]]).f_vector()
(1, 0, 0, 2, 1)
"""
return self.combinatorial_polyhedron().f_vector()

Expand Down
2 changes: 1 addition & 1 deletion src/sage/geometry/polyhedron/parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def change_ring(self, base_ring, backend=None, ambient_dim=None):

def _coerce_base_ring(self, other):
r"""
Return the common base rincg for both ``self`` and ``other``.
Return the common base ring for both ``self`` and ``other``.
This method is not part of the coercion framework, but only a
convenience function for :class:`Polyhedra_base`.
Expand Down

0 comments on commit 3c9085e

Please sign in to comment.