Linear algebra library with no dependency & Why every linear algebra library has LAPACK dependency

bachmeier via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 3 18:43:34 PDT 2015


On Friday, 3 July 2015 at 23:51:30 UTC, kerdemdemir wrote:
> This question is not only about "D linear algebra libraries" 
> but also for other linear algebra libraries in other languages.
>
> I am working with some scientific developers in my current 
> project.
>
> When we were talking I said "I know a great linear algebra 
> library LAPACK" but my friend who is very experienced about 
> numeric told me LAPACK isn't the best library for performance 
> especially if matrix is sparse. In fact he said every numeric 
> developer will try to avoid LAPACK.
>
> Now I want to implement some statistical methods like Bayes, 
> GMM. And I need a linear algebra library. I am looking for a 
> native "module" code which I can directly include my project 
> without dll or I am looking for a library without any 
> dependency. But I see all linear algebra libraries has 
> dependency to LAPACK.
>
> I am sure I am asking this question because I am lacking domain 
> information about maths and linear algebra. But why all 
> libraries has dependency to LAPACK. What make LAPACK 
> irreplaceable ?
>
> Ps: I am not sure if asking questions related to D but not %100 
> about D is a bad habit. If it is please warn me.

You are mixing two things together. An optimized BLAS/LAPACK like 
Intel's MKL or AMD's ACML will deliver great performance. There's 
no reason to avoid them if you use them for the problem they were 
intended to solve, which is matrix algebra for dense matrices. A 
plain vanilla LAPACK with no optimizations definitely won't give 
the best performance (but for many uses even that will be 
sufficiently performant if you're using a language like D or C).

LAPACK is not designed for sparse matrices. As that's outside my 
area, I am not sure what is the best library. The matrix package 
for R calls CSPARSE 
http://people.sc.fsu.edu/~jburkardt/c_src/csparse/csparse.html 
You might want to look at that. It's easy enough to call C 
libraries from D.




More information about the Digitalmars-d-learn mailing list