Skip to content

Commit b8fa032

Browse files
committed
fix transformation parameter for LLL on rational matrices
1 parent 7726cd9 commit b8fa032

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sage/matrix/matrix_rational_dense.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2955,13 +2955,19 @@ cdef class Matrix_rational_dense(Matrix_dense):
29552955
[ 1/28 -1/40 -1/18]
29562956
[ 1/28 -1/40 1/18]
29572957
[ 0 -3/40 0]
2958+
sage: L, U = A.LLL(transformation=True)
2959+
sage: U * A == L
2960+
True
29582961
29592962
sage: A = random_matrix(QQ, 10, 10)
29602963
sage: d = lcm(a.denom() for a in A.list())
29612964
sage: A.LLL() == (A * d).change_ring(ZZ).LLL() / d
29622965
True
29632966
"""
29642967
A, d = self._clear_denom()
2968+
if kwargs.get('transformation', False):
2969+
L, U = A.LLL(*args, **kwargs)
2970+
return L / d, U
29652971
return A.LLL(*args, **kwargs) / d
29662972

29672973
def is_LLL_reduced(self, delta=None, eta=None):

0 commit comments

Comments
 (0)