Skip to main content

OperatorPreconditioner

Trait OperatorPreconditioner 

Source
pub trait OperatorPreconditioner {
    // Required method
    fn apply(&self, r: &[f64], z: &mut [f64]);
}
Expand description

An approximate inverse M^{-1} ~ A^{-1} usable by the generic Krylov drivers.

§Contract

apply writes z = M^{-1} r, with r and z the same length as the system. It must be linear and deterministic for the same reasons LinearOperator::apply must be, and for cg_op it must additionally be symmetric positive definite — preconditioned CG is only a conjugate-gradient method in the M^{-1}-inner product, and an unsymmetric M silently destroys that.

§Units

Dimensionless, as LinearOperator.

Required Methods§

Source

fn apply(&self, r: &[f64], z: &mut [f64])

Write z = M^{-1} r. Both slices have the system length; z is fully overwritten.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§