Skip to main content

Preconditioner

Trait Preconditioner 

Source
pub trait Preconditioner<T: GpuFloat> {
    // Required method
    fn apply(&self, r: &[T], z: &mut [T]) -> SolverResult<()>;
}
Expand description

Preconditioner trait for iterative solvers.

A preconditioner approximates the solution of M * z = r, where M is some approximation of the system matrix A. Applying the preconditioner should be cheaper than solving the original system.

Required Methods§

Source

fn apply(&self, r: &[T], z: &mut [T]) -> SolverResult<()>

Apply preconditioner: approximately solve M * z = r.

Reads from r and writes the result into z.

§Errors

Returns SolverError if the preconditioner application fails.

Implementors§