lattice module provides lattice.
Output LLL reduced basis and a transform matrix. If qudraticform is not specified (or None), distance is represented by the Euclid norm.
Ex.1
>>> M = matrix.Matrix(3, 3, [1, 2, 1, 2, 1, 2, 1, 1, 0]) >>> S = matrix.Matrix(3, 3, [1, 0, 0, 0, 1, 0, 0, 0, 1]) >>> lattice.LLL(M, S) ([0, 1, 2]+[0, -1, 1]+[-1, 0, 0], [-1L, -1L, -1L]+[0L, 1L, 1L]+[1L, 0L, 1L]) >>> lattice.LLL(M) ([0, 1, 2]+[0, -1, 1]+[-1, 0, 0], [-1L, -1L, -1L]+[0L, 1L, 1L]+[1L, 0L, 1L]) >>> T = matrix.Matrix(3, 3, [1, 1, 0, 1, 1, 0, 0, 0, 1]) >>> lattice.LLL(M, T) ([1, 0, 1]+[-1, 0, 2]+[0, -1, 0], [-1L, -1L, 0L]+[1L, 0L, 0L]+[0L, 1L, 1L])
These classes will be used in a future version.