3 ms·
Aha, makes sense. (Now I see that at http://neanderthal.uncomplicate.org/articles/tutorial_native.html. http://neanderthal.uncomplicate.org/articles/tutorial_n
by tmyklebu 9y ago
Aha, makes sense. (Now I see that at http://neanderthal.uncomplicate.org/articles/tutorial_native.html. http://neanderthal.uncomplicate.org/articles/tutorial_native...) Doesn't this make it very painful to do unusual operations on matrices? For example, solving linear systems Ax=b where A is of the form
[ 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 ].
- dragandj 9y agoI do not understand what the form of that matrix has to do with java or native heap. This seems to me as a completely orthogonal issue. As for the triangular form, this is supported in Neanderthal, as well as the rest of special structural sparse shapes.
- tmyklebu 9y ago> I do not understand what the form of that matrix has to do with java or native heap. This seems to me as a completely orthogonal issue. As for the triangular form, this is supported in Neanderthal, as well as the rest of special structural sparse shapes. 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.
- dragandj 9y agoSure! If you need to efficiently implement that yourself, you can use OpenCL to implement the kernels on the CPU, or OpenCL & CUDA on the GPU (If that makes sense). Check out ClojureCUDA and ClojureCL.