Opened 10 months ago

Last modified 10 months ago

#29866 closed defect

closest_vector for IntegerLattice is broken — at Version 2

Reported by: dimpase Owned by:
Priority: blocker Milestone: sage-9.2
Component: number theory Keywords: round
Cc: malb, slelievre, chapoton Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by slelievre)

In this example we compute v, the closest vector to the vector u that lies in the integer lattice L.

Problem: v is not in L.

sage: from sage.modules.free_module_integer import IntegerLattice
sage: M = matrix(ZZ, [[20957228, -4966110], [9411844, 19625639]])
sage: L = IntegerLattice(M)
sage: u = vector([-423434678248195, -18882583298608161305227077482])
sage: v = L.closest_vector(u)
sage: print(v in L)

A simplified version of Taylor Huang's example posted on sage-devel (

Change History (2)

comment:1 Changed 10 months ago by mkoeppe

  • Description modified (diff)

comment:2 Changed 10 months ago by slelievre

  • Cc slelievre added
  • Description modified (diff)
Note: See TracTickets for help on using tickets.