2
$\begingroup$

I'm looking for some FOSS/GPL programs (or Python libraries) for dealing with sparse matrices. I haven't found much online about these. Can someone please point me in the right direction?

$\endgroup$
2
  • 2
    $\begingroup$ Shouldn't you ask this at stackoverflow ? $\endgroup$
    – Graviton
    Sep 27, 2010 at 12:11
  • 1
    $\begingroup$ I have. No luck. It's mathematical, not programming. "Any programming language will do," I was told. $\endgroup$
    – ixtmixilix
    Sep 28, 2010 at 21:54

3 Answers 3

2
$\begingroup$

ARPACK is the most common and effective solution to problems involving large matrices (both sparse and dense). It's a FORTRAN library (with C++ bindings) and a very stable/mature one at that. I know personally that it is used extensively in academia, so I strongly recommend you give it a go.

In terms of Python, I believe SciPy/NumPY actually includes wrappers for ARPACK, though you'll need to investigate this a bit more. The actual implementation is written in C, so efficiency is not at all a problem.

$\endgroup$
5
  • $\begingroup$ ARPACK is useful for calculating eigenvalue; it's not a general purpose sparse matrix manipulation. $\endgroup$
    – Graviton
    Sep 27, 2010 at 12:52
  • $\begingroup$ Well, you can solve linear systems with Arnoldi, but it's a bit like using a gold brick to swat flies... $\endgroup$ Sep 27, 2010 at 13:55
  • $\begingroup$ @ARPACK: It can do a bit more than that as I understand, including decomposition. Also, I did point out SciPy/NumPy, which is more general purpose. You're a harsh judge, is all I can say! $\endgroup$
    – Noldorin
    Sep 27, 2010 at 14:12
  • $\begingroup$ too many of 'em on SE sites these days $\endgroup$
    – ixtmixilix
    Sep 28, 2010 at 21:56
  • $\begingroup$ @ixtmixilix: Agreed. It seems to attract a lot of the anal-retentive sort, oh well. $\endgroup$
    – Noldorin
    Sep 28, 2010 at 22:21
2
$\begingroup$

I haven't really seen any serious numerical computing being done in Python; FORTRAN is still standard, and Netlib has a number of (free!) libraries for solving sparse linear systems, sparse eigenproblems, ... etc. You are of course welcome to construct an interface from Python to these, or probably even better, translate these into Python. Good luck!

$\endgroup$
3
  • $\begingroup$ Oh, I don't know if you consider these as serious but we have this, this and this. I used the first one and it is pretty good. Long story short, control theory and robotics people start to have enough of MATLAB and moving veeeery slowly to other platforms. $\endgroup$
    – user13838
    Sep 28, 2011 at 10:49
  • $\begingroup$ @percusse: that time I posted that answer, I haven't seen 'em. ;) Wow, it's been a year already? Daaaang... $\endgroup$ Sep 28, 2011 at 16:08
  • $\begingroup$ No problem, I realized it before I post it, but I just wanted to mention those for the record, next year nobody will ever notice that they are 1 year apart. ;) $\endgroup$
    – user13838
    Sep 28, 2011 at 16:28
1
$\begingroup$

For general purpose, easy-to-use libraries, consider using tempelated libraries, such as MTL4, eigen, gmm++, ...etc. This article presents a bunch of them.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .