Skip to content
Snippets Groups Projects
Commit a785145d authored by Christoph Groth's avatar Christoph Groth
Browse files

fix: lll() did not accept arbitrary arraylikes

parent 7036afd3
No related branches found
No related tags found
No related merge requests found
...@@ -56,14 +56,14 @@ def lll(basis, c=1.34): ...@@ -56,14 +56,14 @@ def lll(basis, c=1.34):
Coefficient matrix for tranforming from the reduced basis to the Coefficient matrix for tranforming from the reduced basis to the
original one. original one.
""" """
vecs = np.copy(basis) vecs_orig = np.asarray(basis, float)
if vecs.ndim != 2: if vecs_orig.ndim != 2:
raise ValueError('`vecs` must be a 2d array-like object.') raise ValueError('"basis" must be a 2d array-like object.')
if vecs.shape[0] > vecs.shape[1]: if vecs_orig.shape[0] > vecs_orig.shape[1]:
raise ValueError('The number of basis vectors exceeds the ' raise ValueError('The number of basis vectors exceeds the '
'space dimensionality.') 'space dimensionality.')
vecs_orig = np.copy(vecs) vecs = vecs_orig.copy()
vecsstar = np.copy(vecs) vecsstar = vecs_orig.copy()
m = vecs.shape[0] m = vecs.shape[0]
u = np.identity(m) u = np.identity(m)
def ll_reduce(i): def ll_reduce(i):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment