pub struct Poly<I, T> { /* private fields */ }Expand description
Polynomial preconditioner M^{-1} = p(A).
Stores an owned copy of A and the polynomial coefficients. Apply is a
sequence of sparse matvecs and vector updates with no triangular solves and
no heap allocation. See the module documentation for guidance.
Implementations§
Source§impl<I: Index, T: ComplexField> Poly<I, T>
impl<I: Index, T: ComplexField> Poly<I, T>
Sourcepub fn try_new(
a: SparseColMatRef<'_, I, T>,
params: PolyParams,
) -> Result<Self, PolyError>
pub fn try_new( a: SparseColMatRef<'_, I, T>, params: PolyParams, ) -> Result<Self, PolyError>
Build a polynomial preconditioner with an explicit PolyKind.
§Errors
PolyError::NonSquareMatrixifais not square.PolyError::ZeroDegreeifdegreeis zero.PolyError::InvalidOmega/PolyError::InvalidBoundsif the kind parameters are out of range.
Sourcepub fn try_new_auto(
a: SparseColMatRef<'_, I, T>,
degree: usize,
estimate: BoundEstimate,
) -> Result<Self, PolyError>
pub fn try_new_auto( a: SparseColMatRef<'_, I, T>, degree: usize, estimate: BoundEstimate, ) -> Result<Self, PolyError>
Build a Chebyshev preconditioner, estimating the spectral interval with
estimate.
Chebyshev acceleration is only as good as its bounds; see
BoundEstimate. For precise control pass BoundEstimate::Manual or
use Poly::try_new with PolyKind::Chebyshev.
§Errors
As Poly::try_new, plus PolyError::InvalidBounds if the estimate
does not yield a usable 0 < lambda_min < lambda_max.
Sourcepub fn refactorize(
&mut self,
a: SparseColMatRef<'_, I, T>,
) -> Result<(), PolyError>
pub fn refactorize( &mut self, a: SparseColMatRef<'_, I, T>, ) -> Result<(), PolyError>
Refactorise against a new matrix with the same sparsity pattern.
Updates the stored operator values in place. If the preconditioner was
built via Poly::try_new_auto, the spectral bounds are re-estimated
from the new values; otherwise the original PolyKind is retained.
§Errors
PolyError::PatternMismatch if a’s shape or column lengths disagree
with the stored pattern.
Trait Implementations§
Source§impl<I, T> BiLinOp<T> for Poly<I, T>
impl<I, T> BiLinOp<T> for Poly<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
self to a matrix with rhs_ncols columnsSource§impl<I, T> BiPrecond<T> for Poly<I, T>
impl<I, T> BiPrecond<T> for Poly<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
self to a matrix with rhs_ncols columns in placeSource§impl<I, T> LinOp<T> for Poly<I, T>
impl<I, T> LinOp<T> for Poly<I, T>
Source§fn apply_scratch(&self, rhs_ncols: usize, _par: Par) -> StackReq
fn apply_scratch(&self, rhs_ncols: usize, _par: Par) -> StackReq
self or the conjugate
o self to a matrix with rhs_ncols columnsSource§impl<I, T> Precond<T> for Poly<I, T>
impl<I, T> Precond<T> for Poly<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
self or the conjugate
of self to a matrix with rhs_ncols columns in placeAuto Trait Implementations§
impl<I, T> Freeze for Poly<I, T>where
T: Freeze,
impl<I, T> RefUnwindSafe for Poly<I, T>where
T: RefUnwindSafe,
I: RefUnwindSafe,
impl<I, T> Send for Poly<I, T>
impl<I, T> Sync for Poly<I, T>
impl<I, T> Unpin for Poly<I, T>
impl<I, T> UnsafeUnpin for Poly<I, T>where
T: UnsafeUnpin,
impl<I, T> UnwindSafe for Poly<I, T>where
T: UnwindSafe,
I: 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
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>
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>
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