sparse matrix library for C++

Li Ming picture Li Ming · Jun 21, 2013 · Viewed 13.5k times · Source

Is there any sparse matrix library that can do these:

  • solve linear algebraic equations
  • support operations like matrix-matrix/number multiplication/addition/subtraction,matrix transposition, get a row/column of a matrix,and so on
  • matrix size could be 40k*40k or bigger,like 250k*250k
  • fast
  • can be used in Windows

Can someone recommend some libraries for me? If you recommend, please tell me the advantages and disadvantages of it, and the reason why you recommend it.

By the way,I have searched many sparse matrix libraries on the internet and tested some of them. I found that each of them only supported very few operations(many of them can only solve linear algebraic equations and do matrix-vector multiplication) .Finally I found one named SparseLib++. It didn't support many operations, either.So I added a lot of basic matrix operations. Now it works. However, I just heard that SparseLib++ was too old and not fast. But my project is based on SparseLib++ and I have spent a lot of work on SparseLib++. So I am wondering whether to try another sparse matrix library or not.

Answer

dranxo picture dranxo · Jul 10, 2013

http://www.mcs.anl.gov/petsc/ has a lot of built in linear algebra and ca distribute matrices over a cluster when your data gets big. There's also an active following on https://scicomp.stackexchange.com/ when you have technical questions. The downside is that the learning curve is a bit steep.