pub struct JacobiPreconditioner<F> { /* private fields */ }Expand description
Jacobi (diagonal) preconditioner.
Uses M = diag(A), so M^{-1} r = r ./ diag(A).
Effective when the matrix is diagonally dominant.
Implementations§
Source§impl<F: Float + SparseElement + Debug> JacobiPreconditioner<F>
impl<F: Float + SparseElement + Debug> JacobiPreconditioner<F>
Sourcepub fn new(matrix: &CsrMatrix<F>) -> SparseResult<Self>
pub fn new(matrix: &CsrMatrix<F>) -> SparseResult<Self>
Create a Jacobi preconditioner from a CSR matrix.
Returns an error if any diagonal element is zero or near-zero.
Sourcepub fn from_diagonal(diagonal: Array1<F>) -> SparseResult<Self>
pub fn from_diagonal(diagonal: Array1<F>) -> SparseResult<Self>
Create a Jacobi preconditioner from an explicit diagonal vector.
Trait Implementations§
Source§impl<F: Float + SparseElement> Preconditioner<F> for JacobiPreconditioner<F>
impl<F: Float + SparseElement> Preconditioner<F> for JacobiPreconditioner<F>
Auto Trait Implementations§
impl<F> Freeze for JacobiPreconditioner<F>
impl<F> RefUnwindSafe for JacobiPreconditioner<F>where
F: RefUnwindSafe,
impl<F> Send for JacobiPreconditioner<F>where
F: Send,
impl<F> Sync for JacobiPreconditioner<F>where
F: Sync,
impl<F> Unpin for JacobiPreconditioner<F>
impl<F> UnsafeUnpin for JacobiPreconditioner<F>
impl<F> UnwindSafe for JacobiPreconditioner<F>where
F: RefUnwindSafe,
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> 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