neanderthal icon indicating copy to clipboard operation
neanderthal copied to clipboard

`ls` documentation could use clarification

Open kxygk opened this issue 2 years ago • 1 comments

the documentation for ls could maybe be clarified a bit.

if you have ax=b a is 3-by-2 b is 3-by-1 then x should be 2-by-1

ls! as well as ls however both returns a 3-by-1 The docstring however strongly suggests you will get x back!

at least with ls! this is maybe understandable b/c it's reusing memory - but it'd be nice to make a note of what's going on

I was scratching my head for a couple hours trying to figure out what the heck was going on and why my results were the wrong dimension. I only figured it out when I saw in your example: https://dragan.rocks/articles/17/Clojure-Numerics-5-Orthogonalization-and-Least-Squares that the value corresponds to unused terms in the direct QR backsubstitution

Subsequent rows should just discarded if you are looking for the least squared solutions to your b columns

Thanks for the great library as always :)

kxygk avatar Feb 21 '22 14:02 kxygk

Thank you for reporting that. I'll see to make it more clear.

blueberry avatar Feb 21 '22 20:02 blueberry