I am working on a project with electrical circuits, where I am trying to compute the voltages at all the nodes of an electrical circuit. I know that the electrical circuit is a perfect grid, so each node only touches at most 8 other nodes. Which means that I endup trying to solve a system:L v = iwhere L is at least a 1000x1000 matrix where each row has only 9 non-zeros. So, it's really really sparse.I have tried solving it using SoPlex, LaPACK and SuperLU (these last 2 through Armadillo). But all are too slow. On a 10000x10000 the best I have is 18s.I know there is another software that does the same task as mine, written in Python that uses Scipy (scipy.sparse.linalg to be precise) that is ridiculously fast (can solve those systems in less than one second). Is there a library that is equivalent to Scipy or a way of porting Scipy to C++? I need to write the software in C++, for other reasons...EDIT: My code to call SuperLU/LaPACK through Armadillo is simply:voltages[i] = spsolve(laplacians[i],iflow[i],lapack);Or voltages[i] = spsolve(laplacians[i],iflow[i],superlu);No options have been given before.
Fast c++ library to solve very big sparse systems
linear solver;sparse;scipy;lapack
I second the idea of using Eigen, which is pretty efficient, but also very simple to include.If you need a lot more performance, you could try to use PETSc or  Trilinos. They are very powerful libraries to store and solve sparse systems, they allow for  a large number of iterative or direct solvers and are compatible with MPI for added performance. However, I think that they would be highly efficient even in serial.