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

Commit

Permalink
Polyhedron_base.affine_hull_manifold: New
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Apr 11, 2021
1 parent 824f9cc commit c2e6c55
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10070,7 +10070,7 @@ def affine_hull_projection(self, as_affine_map=False, orthogonal=False,
sage: AA(Pgonal.volume()^2) == (Pnormal.volume()^2)*AA(Adet)
True
An other example with ``as_affine_map=True``::
Another example with ``as_affine_map=True``::
sage: P = polytopes.permutahedron(4)
sage: A, b = P.affine_hull_projection(orthonormal=True, as_affine_map=True, extend=True)
Expand Down Expand Up @@ -10249,6 +10249,53 @@ def affine_hull_projection(self, as_affine_map=False, orthogonal=False,

affine_hull = deprecated_function_alias(29326, affine_hull_projection)

def affine_hull_manifold(self, name=None, latex_name=None, start_index=0, ambient_space=None,
names=None, **kwds):
"""
Return the affine hull of ``self`` as a submanifold of the ambient Euclidean space.
INPUT:
- ``ambient_space`` -- a :class:`~sage.manifolds.differentiable.examples.euclidean.EuclideanSpace`
of the ambient dimension (default: a new instance of ``EuclideanSpace``)
the ambient space.
- optional arguments accepted by :meth:`~sage.geometry.polyhedron.base.affine_hull_projection`.
The default chart is determined by the optional arguments of
:meth:`~sage.geometry.polyhedron.base.affine_hull_projection`.
EXAMPLES::
sage: triangle = Polyhedron([(1,0,0), (0,1,0), (0,0,1)]); triangle
A 2-dimensional polyhedron in ZZ^3 defined as the convex hull of 3 vertices
sage: triangle.affine_hull_manifold()
"""
if ambient_space is None:
from sage.manifolds.differentiable.examples.euclidean import EuclideanSpace
ambient_space = EuclideanSpace(self.ambient_dim(), start_index=start_index)
CE = ambient_space.default_chart()

from sage.manifolds.manifold import Manifold
if name is None:
name = 'H'
H = Manifold(self.dim(), name, ambient=ambient_space,
latex_name=latex_name, start_index=start_index)
if names is None:
names = tuple(f'x{i}' for i in range(self.dim()))
CH = H.chart(names=names)

# The inverse
A, b = self.affine_hull_projection(as_affine_map=True, **kwds)


#phi = H.continuous_map(ambient_space, {(CH, CE): ....}
#H.set_embedding()
return H

def _polymake_init_(self):
"""
Return a polymake "Polytope" object corresponding to ``self``.
Expand Down

0 comments on commit c2e6c55

Please sign in to comment.