pub trait KPreconditioner: Send {
type Scalar: KrystScalar;
// Required methods
fn dims(&self) -> (usize, usize);
fn apply_s(
&self,
side: PcSide,
x: &[Self::Scalar],
y: &mut [Self::Scalar],
scratch: &mut BridgeScratch,
) -> Result<(), KError>;
// Provided methods
fn apply_op_s(
&self,
op: Op,
x: &[Self::Scalar],
y: &mut [Self::Scalar],
scratch: &mut BridgeScratch,
) -> Result<(), KError> { ... }
fn capabilities_s(&self) -> PcCaps { ... }
fn apply_mut_s(
&mut self,
side: PcSide,
x: &[Self::Scalar],
y: &mut [Self::Scalar],
scratch: &mut BridgeScratch,
) -> Result<(), KError> { ... }
fn on_restart_s(
&mut self,
outer_iter: usize,
residual_norm: <Self::Scalar as KrystScalar>::Real,
) -> Result<(), KError> { ... }
}Expand description
Internal, scalar-generic preconditioner interface.
The trait is object safe so solvers can work with Arc<dyn KPreconditioner<Scalar = S> + Sync> when
sharing a handle between threads, or with mutable references when per-thread access is sufficient.
Required Associated Types§
type Scalar: KrystScalar
Required Methods§
Provided Methods§
Sourcefn apply_op_s(
&self,
op: Op,
x: &[Self::Scalar],
y: &mut [Self::Scalar],
scratch: &mut BridgeScratch,
) -> Result<(), KError>
fn apply_op_s( &self, op: Op, x: &[Self::Scalar], y: &mut [Self::Scalar], scratch: &mut BridgeScratch, ) -> Result<(), KError>
Apply a selected matrix operation through the preconditioner.
Sourcefn capabilities_s(&self) -> PcCaps
fn capabilities_s(&self) -> PcCaps
Capabilities exposed by the wrapped preconditioner.
Sourcefn apply_mut_s(
&mut self,
side: PcSide,
x: &[Self::Scalar],
y: &mut [Self::Scalar],
scratch: &mut BridgeScratch,
) -> Result<(), KError>
fn apply_mut_s( &mut self, side: PcSide, x: &[Self::Scalar], y: &mut [Self::Scalar], scratch: &mut BridgeScratch, ) -> Result<(), KError>
Apply the preconditioner in a mutable/flexible mode.
By default this delegates to apply_s, preserving backwards compatibility for
immutable preconditioners while allowing flexible algorithms (e.g., FGMRES) to
request a mutable handle when available.
Sourcefn on_restart_s(
&mut self,
outer_iter: usize,
residual_norm: <Self::Scalar as KrystScalar>::Real,
) -> Result<(), KError>
fn on_restart_s( &mut self, outer_iter: usize, residual_norm: <Self::Scalar as KrystScalar>::Real, ) -> Result<(), KError>
Optional hook invoked at solver restarts.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl KPreconditioner for AMG
Available on crate features backend-faer and complex only.
impl KPreconditioner for AMG
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for Asm
Available on crate features backend-faer and complex only.
impl KPreconditioner for Asm
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for AsmAmg
Available on crate features backend-faer and complex only.
impl KPreconditioner for AsmAmg
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for BlockJacobi
Available on crate features backend-faer and complex only.
impl KPreconditioner for BlockJacobi
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for ChebyshevPc
Available on crate features backend-faer and complex only.
impl KPreconditioner for ChebyshevPc
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for FsaiCsr
Available on crate features backend-faer and complex only.
impl KPreconditioner for FsaiCsr
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for Ilu
Available on crate features backend-faer and complex only.
impl KPreconditioner for Ilu
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for IluCsr
Available on crate features backend-faer and complex only.
impl KPreconditioner for IluCsr
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for Ilup
Available on crate features backend-faer and complex only.
impl KPreconditioner for Ilup
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for Ilutp
Available on crate features backend-faer and complex only.
impl KPreconditioner for Ilutp
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for Jacobi
Available on crate feature complex only.
impl KPreconditioner for Jacobi
Available on crate feature
complex only.Source§impl KPreconditioner for LegacyOpPreconditioner
Available on crate features complex and legacy-pc-bridge only.
impl KPreconditioner for LegacyOpPreconditioner
Available on crate features
complex and legacy-pc-bridge only.Source§impl KPreconditioner for LuPc
Available on crate features backend-faer and complex and dense-direct only.
impl KPreconditioner for LuPc
Available on crate features
backend-faer and complex and dense-direct only.Source§impl KPreconditioner for OverlapIluPc
Available on crate features backend-faer and complex only.
impl KPreconditioner for OverlapIluPc
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for PcChain
Available on crate feature complex only.
impl KPreconditioner for PcChain
Available on crate feature
complex only.Source§impl KPreconditioner for QrPc
Available on crate features backend-faer and complex and dense-direct only.
impl KPreconditioner for QrPc
Available on crate features
backend-faer and complex and dense-direct only.Source§impl KPreconditioner for RowFilterPreconditioner
Available on crate features backend-faer and complex only.
impl KPreconditioner for RowFilterPreconditioner
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for SorPc
Available on crate features backend-faer and complex only.
impl KPreconditioner for SorPc
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for SpaiCsr
Available on crate features backend-faer and complex only.
impl KPreconditioner for SpaiCsr
Available on crate features
backend-faer and complex only.Source§impl KPreconditioner for SuperLuDistPc
Available on crate features backend-faer and complex only.
impl KPreconditioner for SuperLuDistPc
Available on crate features
backend-faer and complex only.Source§impl<M> KPreconditioner for ApproxInv<M, Vec<f64>, f64>
Available on crate features backend-faer and complex only.
impl<M> KPreconditioner for ApproxInv<M, Vec<f64>, f64>
Available on crate features
backend-faer and complex only.Source§impl<PB> KPreconditioner for DeflationPC<PB>where
PB: Preconditioner,
Available on crate features backend-faer and complex only.
impl<PB> KPreconditioner for DeflationPC<PB>where
PB: Preconditioner,
Available on crate features
backend-faer and complex only.