pub struct JacobiPreconditioner<F> { /* private fields */ }
Expand description
Jacobi (diagonal) preconditioner
This preconditioner uses the inverse of the diagonal of the matrix. M^(-1) = diag(1/a_11, 1/a_22, …, 1/a_nn)
Implementations§
Source§impl<F: Float> JacobiPreconditioner<F>
impl<F: Float> JacobiPreconditioner<F>
Sourcepub fn new(matrix: &CsrMatrix<F>) -> SparseResult<Self>where
F: Debug,
pub fn new(matrix: &CsrMatrix<F>) -> SparseResult<Self>where
F: Debug,
Create a new Jacobi preconditioner from a sparse matrix
Sourcepub fn from_diagonal(diagonal: Vec<F>) -> SparseResult<Self>
pub fn from_diagonal(diagonal: Vec<F>) -> SparseResult<Self>
Create from diagonal values directly
Trait Implementations§
Source§impl<F: Float + NumAssign> LinearOperator<F> for JacobiPreconditioner<F>
impl<F: Float + NumAssign> LinearOperator<F> for JacobiPreconditioner<F>
Source§fn has_adjoint(&self) -> bool
fn has_adjoint(&self) -> bool
Check if the operator supports adjoint operations
Source§fn rmatvec(&self, x: &[F]) -> SparseResult<Vec<F>>
fn rmatvec(&self, x: &[F]) -> SparseResult<Vec<F>>
Apply the adjoint of the operator to a vector: y = A^H * x
Default implementation returns an error
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>where
F: Unpin,
impl<F> UnwindSafe for JacobiPreconditioner<F>where
F: 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> 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