Skip to main content

LinearSolver

Trait LinearSolver 

Source
pub trait LinearSolver: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn capabilities(&self) -> SolverCapabilities;
    fn factor(&mut self, matrix: &SparseMatrix) -> Result<(), SolverError>;
    fn solve(&self, rhs: &[f64]) -> Result<Vec<f64>, SolverError>;

    // Provided method
    fn solve_many(&self, rhs: &[Vec<f64>]) -> Result<Vec<Vec<f64>>, SolverError> { ... }
}
Expand description

Trait for linear solvers that can factorize and solve

Required Methods§

Source

fn name(&self) -> &'static str

Get solver name

Source

fn capabilities(&self) -> SolverCapabilities

Get solver capabilities

Source

fn factor(&mut self, matrix: &SparseMatrix) -> Result<(), SolverError>

Factorize the matrix

Source

fn solve(&self, rhs: &[f64]) -> Result<Vec<f64>, SolverError>

Solve for a single RHS (requires prior factorization)

Provided Methods§

Source

fn solve_many(&self, rhs: &[Vec<f64>]) -> Result<Vec<Vec<f64>>, SolverError>

Solve for multiple RHS (requires prior factorization)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§