Skip to content

CholmodSolver: Allow to reuse a factorization

This is part of !58 and should be merged separately.

Computing Cholesky factorizations is expensive, and they absolutely have to be reused if the same linear system is solved with several different right hand sides. The previous implementation of CholmodSolver wouldn't allow this: The 'solve' method factorized and solved together.

This patch makes the interface of the CholmodSolver class richer to allow for factorization reuse. It is now possible to set the matrix, rhs and solution storage separately. The matrix can be factorized by calling a new 'factorize' method, and if 'solve' is called afterwards, the matrix won't be factorized again.

On the other hand, when calling 'solve' by itself the 'solve' method will do the factorization. In other words, the patch is fully backward-compatible.

Merge request reports