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 = i
L is at least a 1000x1000 matrix where each row has only 9 non-zeros. So, it's really really sparse.
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");
voltages[i] = spsolve(laplacians[i],iflow[i],"superlu");
No options have been given before.