Skip to content

Commit 1cce2b8

Browse files
author
Matthias Koeppe
committed
src/sage/modules/free_module_integer.py: Compare norm squares instead of norms
1 parent 4ff67bb commit 1cce2b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sage/modules/free_module_integer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,10 @@ def LLL(self, *args, **kwds):
384384
basis = matrix(ZZ, len(basis), len(basis[0]), basis)
385385
basis.set_immutable()
386386

387-
if self.reduced_basis[0].norm() > basis[0].norm():
387+
b0 = basis[0]
388+
rb0 = self.reduced_basis[0]
389+
390+
if rb0.dot_product(rb0) > b0.dot_product(b0):
388391
self._reduced_basis = basis
389392
return basis
390393

0 commit comments

Comments
 (0)