pub trait SparseSolver<F: Float> {
// Required methods
fn factorize(&mut self, matrix: &CsrMatrix<F>) -> SparseResult<()>;
fn solve(&self, b: &[F]) -> SparseResult<Vec<F>>;
// Provided method
fn solve_multi(&self, b_columns: &[Vec<F>]) -> SparseResult<Vec<Vec<F>>> { ... }
}Expand description
Trait for sparse direct solvers.
A solver follows the factorize-then-solve paradigm:
- Call
factorize()to compute the decomposition. - Call
solve()(orsolve_multi()) one or more times.
Required Methods§
Sourcefn factorize(&mut self, matrix: &CsrMatrix<F>) -> SparseResult<()>
fn factorize(&mut self, matrix: &CsrMatrix<F>) -> SparseResult<()>
Compute the factorization of the given matrix.
Sourcefn solve(&self, b: &[F]) -> SparseResult<Vec<F>>
fn solve(&self, b: &[F]) -> SparseResult<Vec<F>>
Solve A x = b using the stored factorization.
Provided Methods§
Sourcefn solve_multi(&self, b_columns: &[Vec<F>]) -> SparseResult<Vec<Vec<F>>>
fn solve_multi(&self, b_columns: &[Vec<F>]) -> SparseResult<Vec<Vec<F>>>
Solve A X = B for multiple right-hand sides (columns of B).