Skip to content

Commit

Permalink
Trac #27329: Polyhedron/base: very minor "fixes"
Browse files Browse the repository at this point in the history
This ticket contains some collected very minor "fixes" (not even sure if
they would be called that way) after going through the docs/file.

URL: https://trac.sagemath.org/27329
Reported by: dkrenn
Ticket author(s): Daniel Krenn
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager authored and vbraun committed Feb 25, 2019
2 parents 2d21b7c + 74470e2 commit 7422882
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5144,7 +5144,8 @@ def integrate(self, polynomial, **kwds):
raise NotImplementedError("The polytope must be full-dimensional.")
else:
from sage.interfaces.latte import integrate
return integrate(self.cdd_Hrepresentation(), polynomial, cdd=True)
return integrate(self.cdd_Hrepresentation(), polynomial,
cdd=True, **kwds)

def contains(self, point):
"""
Expand Down Expand Up @@ -6588,7 +6589,7 @@ def affine_hull(self, as_affine_map=False, orthogonal=False, orthonormal=False,
- ``as_affine_map`` (boolean, default = False) -- If ``False``, return
a polyhedron. If ``True``, return the affine transformation,
that sends the embedded polytope to a fulldimensional one.
It is given as a pair ``(A,b)``, where A is a linear transformation
It is given as a pair ``(A, b)``, where A is a linear transformation
and ``b`` is a vector, and the affine transformation sends ``v`` to
``A(v)+b``.
Expand Down Expand Up @@ -6651,6 +6652,11 @@ def affine_hull(self, as_affine_map=False, orthogonal=False, orthonormal=False,
sage: S = polytopes.simplex(); S
A 3-dimensional polyhedron in ZZ^4 defined as the convex hull of 4 vertices
sage: S.vertices()
(A vertex at (0, 0, 0, 1),
A vertex at (0, 0, 1, 0),
A vertex at (0, 1, 0, 0),
A vertex at (1, 0, 0, 0))
sage: A = S.affine_hull(); A
A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 4 vertices
sage: A.vertices()
Expand Down Expand Up @@ -6752,7 +6758,7 @@ def affine_hull(self, as_affine_map=False, orthogonal=False, orthonormal=False,
sage: Pentagon = polytopes.dodecahedron().faces(2)[0].as_polyhedron()
sage: Pnormal = Pentagon.affine_hull(orthonormal=True, extend=True)
sage: Pgonal = Pentagon.affine_hull(orthogonal=True)
sage: A,b = Pentagon.affine_hull(orthogonal = True, as_affine_map=True)
sage: A, b = Pentagon.affine_hull(orthogonal=True, as_affine_map=True)
sage: Adet = (A.matrix().transpose()*A.matrix()).det()
sage: Pnormal.volume()
1.53406271079097?
Expand All @@ -6766,7 +6772,7 @@ def affine_hull(self, as_affine_map=False, orthogonal=False, orthonormal=False,
An other example with ``as_affine_map=True``::
sage: P = polytopes.permutahedron(4)
sage: A,b = P.affine_hull(orthonormal=True, as_affine_map=True, extend=True)
sage: A, b = P.affine_hull(orthonormal=True, as_affine_map=True, extend=True)
sage: Q = P.affine_hull(orthonormal=True, extend=True)
sage: Q.center()
(0.7071067811865475?, 1.224744871391589?, 1.732050807568878?)
Expand Down

0 comments on commit 7422882

Please sign in to comment.