3

I need to solve a large, sparse system of linear equations from a program written in D. Ideally I'd like a library with a D-style interface, but I doubt one exists. However, D can directly access C APIs. Therefore, please suggest some libraries that solve large, sparse systems of linear equations with the following characteristics:

  1. Exposes a C API.

  2. Free/open source. Preferably non-copyleft, too, but this is not a hard requirement.

  3. Well-tested and debugged. Easy to set up and use. Not written by academics just to get a paper on their method and then completely unmaintained.

Roman Byshko
  • 8,591
  • 7
  • 35
  • 57
dsimcha
  • 67,514
  • 53
  • 213
  • 334

3 Answers3

6

The classical library for sparse problem is suite-sparse. You have packages on many systems. Matlab uses it internally.

hpixel
  • 260
  • 1
  • 10
  • 1
    I cannot comment on your post yet (not enough rep...). But I particularly appreciate your impression on what academics produce. BTW suite-sparse has been produced by academics and *is* maintained. – hpixel Nov 16 '11 at 19:40
  • I personally can vouch for this code. I use it in my app and everything I have seen from Tim Davis is of the highest quality. – David Heffernan Nov 16 '11 at 19:41
  • I would point out that Tim Davis' code is not free for commercial use. If you have a commercial product yourself then you will find his prices very reasonable. I personally use CSparse which is exceptionally good value. – David Heffernan Nov 16 '11 at 19:49
  • @David: I just looked. CSparse is actually LGPL. – dsimcha Nov 16 '11 at 19:57
  • OK, so you have to ship a shared library then, or give up your code. – David Heffernan Nov 16 '11 at 19:59
  • Thanks, I managed to actually get this up and running. Works great. – dsimcha Nov 16 '11 at 22:57
1

My bad, I tangle LAPACK that I used old time ago and ARPACK that I used more time ago.

Here is link to arpack http://www.caam.rice.edu/~kristyn/parpack_home.html: The package is designed to compute a few eigenvalues and corresponding eigenvectors of a general n by n matrix A. It is most appropriate for large sparse or structured matrices.

And here link with comparison of libaries for Linear Algebra:

http://www.netlib.org/utk/people/JackDongarra/la-sw.html

you can find there SparseLib++, mentioned here arpack and much more libaries in matrix form.

fghj
  • 8,898
  • 4
  • 28
  • 56
  • Without calling out the sparse codes in the enormous LAPACK, this is a non-answer. Can you edit to provide the missing details? – David Heffernan Nov 16 '11 at 19:42
  • @David: Good point. I am actually using LAPACK now (though a wrapper, not directly) and I was under the impression that it didn't have any sparse support. If I'm wrong, I'd love to be corrected because it would make my life a lot easier. – dsimcha Nov 16 '11 at 19:44
  • LAPACK itself doesn't do sparse matrices. The netlib repository has many good options. – David Heffernan Nov 16 '11 at 19:47
0

There is a dedicated package called CSPARSE, and it's written in C. It seems that the implemention is based on [david2006direct].

Edward
  • 554
  • 8
  • 15