I'm sorry if this is explained clearly in the scipy.sparse documentation.
When using scipy, what function would you recommend using to solve a sparse positive definite linear system of equations? I want to use a direct method, and I want the columns to be reordered so as to preserve sparsity as much as possible in the Cholesky factorization of the coefficient matrix. Ideally I'd be able to experiment with various options for reordering.
Does a direct solver for sparse positive definite systems exist in scipy.sparse? Is scikit.sparse the way to go?
scipy.sparse.linalg.spsolve is clear enough, but it seems that for speed you must
pip install
scikit-umfpackor else
[umfpack] umfpack_libs = ...
in site.cfg .otherwise scipy.sparse.linalg defaults to the slower SuperLU.
Compared to what, with what criteria ? If C / C++ is enough for you, use SuiteSparse directly. Any tool depends on what you're comfortable with, and on users: one, two, many. Maybe better visualization would help your project more than faster spsolve.
Some pretty obvious pluses and minuses of scipy.sparse:
+ python for fast development, data input -- matrices -- visualize
+ several packages have built on scipy.sparse; ask around in your application area (which is ?)
- rough edges (matrices are a pain), with afaik no wiki to collect hints and code snippets
- layers upon layers, scipy.sparse -- SuiteSparse -- ... BLAS ... make timing and debugging tough.
Fwiw, solver times vary a lot on my iMac. These are all with default args, without umfpack.
(This is NOT a realistic testcase; but satisficing is often good enough.)