Clojure Numerics: Orthogonalization and Least Squares
dragan.rocks
dragan.rocks
I should have said "or" instead of "and". I think it's a valid question in the context of your code size comparison.
I see what you did there with naming.
[ 1 ]
[ a_2 b_1 1 ]
[ a_3 b_1 a_3 b_2 1 ]
[ ... ... ... ... ]
[ a_n b_1 a_n b_2 a_n b_3 ... a_n b_{n-1} 1 ].You support triangular matrices. However, you can solve a linear system of the form I gave in linear time, while it takes quadratic space and time to form the corresponding triangular matrix and do a triangular solve.
Not all special matrices are supported by BLAS/LAPACK. Other common examples might be block Toeplitz/Hankel matrices for which fast multiplication and fast solvers are available. In order to support special (not in BLAS/LAPACK) matrix operations naturally, you'd want natural, no-extra-copying access to the vectors within Java or Clojure so that you can write the good algorithm manually, as you'd do in C or Fortran.
Nothing quite forces you to understand the issues deeply like implementing it in code!
I haven't gotten to LS/QR yet (just getting the LU working correctly was quite tricky), but when I do I'll make sure to reference your series :)