chrisvwx / LLLplus.jl

Lattice reduction and other lattice tools in Julia
MIT License
48 stars 9 forks source link

`cvp` does not work correctly #61

Closed GiggleLiu closed 2 years ago

GiggleLiu commented 2 years ago
cvp([-2, 0.0], Matrix([1 1.0; 4 0]'))

It got stuck in this expression. It only has dimension 2.

chrisvwx commented 2 years ago

Matrix([1 1.0; 4 0]') is not upper triangular as required for the second argument of cvp. It's not clear to me what problem you want to solve. Did you mean to use code shown below (which is adapted from the help text of cvp)?

H = Matrix([1 1.0; 4 0]');
Q,R = qr(H);
uhat = cvp(Q'*[-2,0],R)
GiggleLiu commented 2 years ago

Thanks, that makes sense. It is safer to dispatch it on UpperTriangular type in my opinion, then people has no chance to input the incorrect arguments.