pub struct JacobiPrecond<T> { /* private fields */ }Expand description
Point-Jacobi preconditioner: M^{-1} y = diag(A)^{-1} y.
Stores the reciprocals of A’s diagonal and multiplies them into the
right-hand side. Apply is O(n) and allocates nothing. See the
module documentation for when this is the right choice.
Implementations§
Source§impl<T> JacobiPrecond<T>
impl<T> JacobiPrecond<T>
Sourcepub fn from_inverse_diagonal(inv_diag: Vec<T>) -> Self
pub fn from_inverse_diagonal(inv_diag: Vec<T>) -> Self
Build directly from the already-inverted diagonal 1 / diag(A).
No checking is done — use this only when you have computed the
reciprocals yourself. Prefer Self::try_from_diagonal otherwise.
Sourcepub fn inverse_diagonal(&self) -> &[T]
pub fn inverse_diagonal(&self) -> &[T]
The stored inverse diagonal, 1 / diag(A).
Source§impl<T: ComplexField> JacobiPrecond<T>
impl<T: ComplexField> JacobiPrecond<T>
Sourcepub fn try_from_diagonal(diag: &[T]) -> Result<Self, JacobiError>
pub fn try_from_diagonal(diag: &[T]) -> Result<Self, JacobiError>
Build from a slice holding the diagonal of A.
§Errors
Returns JacobiError::ZeroDiagonalEntry if any entry is zero.
Sourcepub fn try_from_matrix_diagonal(mat: MatRef<'_, T>) -> Result<Self, JacobiError>
pub fn try_from_matrix_diagonal(mat: MatRef<'_, T>) -> Result<Self, JacobiError>
Build by reading the diagonal of a dense matrix mat.
§Errors
Returns JacobiError::NonSquareMatrix if mat is not square, or
JacobiError::ZeroDiagonalEntry if any diagonal entry is zero.
Trait Implementations§
Source§impl<T> BiLinOp<T> for JacobiPrecond<T>
impl<T> BiLinOp<T> for JacobiPrecond<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<T> BiPrecond<T> for JacobiPrecond<T>
impl<T> BiPrecond<T> for JacobiPrecond<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<T: Clone> Clone for JacobiPrecond<T>
impl<T: Clone> Clone for JacobiPrecond<T>
Source§fn clone(&self) -> JacobiPrecond<T>
fn clone(&self) -> JacobiPrecond<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for JacobiPrecond<T>
impl<T: Debug> Debug for JacobiPrecond<T>
Source§impl<T> LinOp<T> for JacobiPrecond<T>
impl<T> LinOp<T> for JacobiPrecond<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<T> Precond<T> for JacobiPrecond<T>
impl<T> Precond<T> for JacobiPrecond<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<T> Freeze for JacobiPrecond<T>
impl<T> RefUnwindSafe for JacobiPrecond<T>where
T: RefUnwindSafe,
impl<T> Send for JacobiPrecond<T>where
T: Send,
impl<T> Sync for JacobiPrecond<T>where
T: Sync,
impl<T> Unpin for JacobiPrecond<T>where
T: Unpin,
impl<T> UnsafeUnpin for JacobiPrecond<T>
impl<T> UnwindSafe for JacobiPrecond<T>where
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