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

Commit 294fbe1

Browse files
committed
Trac #27366 output affine_map
1 parent 8fa37df commit 294fbe1

File tree

1 file changed

+7
-6
lines changed
  • src/sage/geometry/polyhedron

1 file changed

+7
-6
lines changed

src/sage/geometry/polyhedron/base.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -6954,8 +6954,8 @@ def affine_hull(self, as_polyhedron=None, as_affine_map=False,
69546954
if self.ambient_dim() == self.dim():
69556955
result['polyhedron'] = self
69566956
if as_affine_map or return_all_data:
6957-
result['linear_transformation'] = linear_transformation(matrix(self.base_ring(), self.dim(), self.dim(), self.base_ring().one()))
6958-
result['shift'] = self.ambient_space().zero()
6957+
result['affine_map'] = (linear_transformation(matrix(self.base_ring(), self.dim(), self.dim(), self.base_ring().one())),
6958+
self.ambient_space().zero())
69596959

69606960
elif orthogonal or orthonormal:
69616961
# see TODO
@@ -6980,11 +6980,12 @@ def affine_hull(self, as_polyhedron=None, as_affine_map=False,
69806980
A = M.gram_schmidt(orthonormal=orthonormal)[0]
69816981
if as_polyhedron:
69826982
result['polyhedron'] = Polyhedron(
6983-
[A*vector(A.base_ring(), v) for v in Q.vertices()],
6983+
[A*vector(A.base_ring(), v)
6984+
for v in self.translation(-v0).vertices()],
69846985
base_ring=A.base_ring())
69856986
if as_affine_map:
6986-
result['linear_transformation'] = linear_transformation(A, side='right')
6987-
result['shift'] = -A*vector(A.base_ring(), self.vertices()[0])
6987+
L = linear_transformation(A, side='right')
6988+
result['affine_map'] = (L, -A*vector(A.base_ring(), self.vertices()[0]))
69886989

69896990
else:
69906991
# translate one vertex to the origin
@@ -7017,7 +7018,7 @@ def pivot(indexed):
70177018
if return_all_data or (as_polyhedron and as_affine_map):
70187019
return result
70197020
elif as_affine_map:
7020-
return result['linear_transformation'], result['shift']
7021+
return result['affine_map']
70217022
else:
70227023
return result['polyhedron']
70237024

0 commit comments

Comments
 (0)