-
-
Notifications
You must be signed in to change notification settings - Fork 654
Closed
Closed
Copy link
Labels
Description
Steps To Reproduce
IntegerLattice.closest_vector() sometimes gives answers that seem off, even when the input vector is already in the lattice. The following code triggers the issue:
from sage.modules.free_module_integer import IntegerLattice
v = vector(ZZ, [1,1,1,-1])
L = IntegerLattice([v])
print (v in L)
print (L.closest_vector(v))
Expected Behavior
Since
True
(1,1,1,-1)
Actual Behavior
However, the actual output is
True
(0,0,0,0)
Additional Information
Fist asked in https://ask.sagemath.org/question/77550/integerlatticeclosest_vector-not-finding-a-vector-already-in-the-lattice/.
A different input such as v = vector(ZZ, [1,1,-1])
results in the expected behaviour. So does the method used by fpylll
.
Environment
- **OS**: Gentoo and Manjaro
- **Sage Version**: 10.3
Checklist
- I have searched the existing issues for a bug report that matches the one I want to file, without success.
- I have read the documentation and troubleshoot guide