pub struct BlockJacobiPrecond<T> { /* private fields */ }Expand description
Block-Jacobi preconditioner: M^{-1} y = blkdiag(A_k^{-1}) y.
The factorisation is computed once at construction. apply, apply_in_place,
and the transpose/adjoint variants perform only dense triangular solves and
permutation applications — they require no heap allocation and all scratch
flows through the MemStack provided by faer’s trait interface.
§Storage
All p LU factors are packed contiguously in column-major order into a
single Vec<T>, and the partial-pivoting permutations are packed into two
Vec<usize> of total length n. This keeps the working set cache-friendly
during apply.
Implementations§
Source§impl<T> BlockJacobiPrecond<T>
impl<T> BlockJacobiPrecond<T>
Sourcepub fn block_count(&self) -> usize
pub fn block_count(&self) -> usize
Number of diagonal blocks.
Sourcepub fn block_offsets(&self) -> &[usize]
pub fn block_offsets(&self) -> &[usize]
Slice of length block_count() + 1 giving the row/column offsets of each block.
Sourcepub fn max_block_size(&self) -> usize
pub fn max_block_size(&self) -> usize
Size of the largest block — useful for sizing external scratch buffers.
Source§impl<T: ComplexField> BlockJacobiPrecond<T>
impl<T: ComplexField> BlockJacobiPrecond<T>
Sourcepub fn try_new(
a: MatRef<'_, T>,
block_offsets: &[usize],
) -> Result<Self, BlockJacobiError>
pub fn try_new( a: MatRef<'_, T>, block_offsets: &[usize], ) -> Result<Self, BlockJacobiError>
Build a block-Jacobi preconditioner from a and a block partition.
block_offsets must satisfy block_offsets[0] == 0, the values must
be strictly increasing, and block_offsets[block_offsets.len() - 1]
must equal a.nrows().
§Errors
Returns BlockJacobiError::NonSquareMatrix if a is not square,
validation errors for ill-formed block_offsets, and
BlockJacobiError::SingularBlock if any diagonal block is rank-deficient.
Trait Implementations§
Source§impl<T> BiLinOp<T> for BlockJacobiPrecond<T>
impl<T> BiLinOp<T> for BlockJacobiPrecond<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<T> BiPrecond<T> for BlockJacobiPrecond<T>
impl<T> BiPrecond<T> for BlockJacobiPrecond<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<T: Clone> Clone for BlockJacobiPrecond<T>
impl<T: Clone> Clone for BlockJacobiPrecond<T>
Source§fn clone(&self) -> BlockJacobiPrecond<T>
fn clone(&self) -> BlockJacobiPrecond<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for BlockJacobiPrecond<T>
impl<T: Debug> Debug for BlockJacobiPrecond<T>
Source§impl<T> LinOp<T> for BlockJacobiPrecond<T>
impl<T> LinOp<T> for BlockJacobiPrecond<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<T> Precond<T> for BlockJacobiPrecond<T>
impl<T> Precond<T> for BlockJacobiPrecond<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<T> Freeze for BlockJacobiPrecond<T>
impl<T> RefUnwindSafe for BlockJacobiPrecond<T>where
T: RefUnwindSafe,
impl<T> Send for BlockJacobiPrecond<T>where
T: Send,
impl<T> Sync for BlockJacobiPrecond<T>where
T: Sync,
impl<T> Unpin for BlockJacobiPrecond<T>where
T: Unpin,
impl<T> UnsafeUnpin for BlockJacobiPrecond<T>
impl<T> UnwindSafe for BlockJacobiPrecond<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
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