pub struct Spai<I, T> { /* private fields */ }Expand description
Sparse approximate inverse: M^{-1} = M ~= A^{-1}.
Stores M in CSC. Apply is a single sparse matvec with no triangular solves.
See the module documentation for guidance.
Implementations§
Source§impl<I: Index, T: ComplexField> Spai<I, T>
impl<I: Index, T: ComplexField> Spai<I, T>
Sourcepub fn try_new(
a: SparseColMatRef<'_, I, T>,
pattern: SpaiPattern,
) -> Result<Self, SpaiError>
pub fn try_new( a: SparseColMatRef<'_, I, T>, pattern: SpaiPattern, ) -> Result<Self, SpaiError>
Build a SPAI preconditioner for A.
§Errors
SpaiError::NonSquareMatrixifAis not square.SpaiError::InvalidPowerif aColumnsOfPowerpower is zero.
Trait Implementations§
Source§impl<I, T> BiLinOp<T> for Spai<I, T>
impl<I, T> BiLinOp<T> for Spai<I, T>
Source§fn transpose_apply_scratch(&self, _rhs_ncols: usize, _par: Par) -> StackReq
fn transpose_apply_scratch(&self, _rhs_ncols: usize, _par: Par) -> StackReq
computes the workspace layout required to apply the transpose or adjoint
o
self to a matrix with rhs_ncols columnsSource§impl<I, T> BiPrecond<T> for Spai<I, T>
impl<I, T> BiPrecond<T> for Spai<I, T>
Source§fn transpose_apply_in_place_scratch(
&self,
rhs_ncols: usize,
_par: Par,
) -> StackReq
fn transpose_apply_in_place_scratch( &self, rhs_ncols: usize, _par: Par, ) -> StackReq
computes the workspace layout required to apply the transpose or adjoint
of
self to a matrix with rhs_ncols columns in placeSource§impl<I, T> LinOp<T> for Spai<I, T>
impl<I, T> LinOp<T> for Spai<I, T>
Source§fn apply_scratch(&self, _rhs_ncols: usize, _par: Par) -> StackReq
fn apply_scratch(&self, _rhs_ncols: usize, _par: Par) -> StackReq
computes the workspace layout required to apply
self or the conjugate
o self to a matrix with rhs_ncols columnsSource§impl<I, T> Precond<T> for Spai<I, T>
impl<I, T> Precond<T> for Spai<I, T>
Source§fn apply_in_place_scratch(&self, rhs_ncols: usize, _par: Par) -> StackReq
fn apply_in_place_scratch(&self, rhs_ncols: usize, _par: Par) -> StackReq
computes the workspace layout required to apply
self or the conjugate
of self to a matrix with rhs_ncols columns in placeAuto Trait Implementations§
impl<I, T> Freeze for Spai<I, T>
impl<I, T> RefUnwindSafe for Spai<I, T>where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<I, T> Send for Spai<I, T>
impl<I, T> Sync for Spai<I, T>
impl<I, T> Unpin for Spai<I, T>
impl<I, T> UnsafeUnpin for Spai<I, T>
impl<I, T> UnwindSafe for Spai<I, T>where
I: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more