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

Commit

Permalink
Merge #27366
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Apr 26, 2021
2 parents a47ea80 + eee1aad commit 915389d
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class Polyhedron_base(Element):
sage: TestSuite(Polyhedron([[]])).run()
sage: TestSuite(Polyhedron([[0]])).run()
sage: TestSuite(Polyhedron([[1]])).run()
::
Expand All @@ -155,6 +156,17 @@ class Polyhedron_base(Element):
sage: P = polytopes.permutahedron(3)*Polyhedron(rays=[[0,0,1],[0,1,1]], lines=[[1,0,0]])
sage: TestSuite(P).run()
::
sage: M = random_matrix(ZZ, 5, 5, distribution='uniform')
sage: while True:
....: M = random_matrix(ZZ, 5, 5, distribution='uniform')
....: if M.rank() != 5:
....: break
....:
sage: P = Polyhedron(M)
sage: TestSuite(P).run()
"""

def __init__(self, parent, Vrep, Hrep, Vrep_minimal=None, Hrep_minimal=None, pref_rep=None, **kwds):
Expand Down Expand Up @@ -10420,10 +10432,11 @@ def affine_hull_projection(self, as_polyhedron=None, as_affine_map=False, orthog
if as_polyhedron:
result.polyhedron = A*self
if return_all_data:
E = M.echelon_form()
L_section = linear_transformation(matrix(len(pivots), self.ambient_dim(),
[E[i] for i in range(len(pivots))]).transpose(),
side='right')
if self.dim():
B = M.transpose()/(A*M.transpose())
else:
B = matrix(self.ambient_dim(), 0)
L_section = linear_transformation(B, side='right')
result.section_linear_map = L_section
result.section_translation = v0 - L_section(L(v0) + image_translation)

Expand Down

0 comments on commit 915389d

Please sign in to comment.