Skip to main content

IncompleteCholesky

Struct IncompleteCholesky 

Source
pub struct IncompleteCholesky { /* private fields */ }
Expand description

An incomplete Cholesky factorisation A + α diag(A) ≈ L Lᵀ, with L lower triangular.

Implementations§

Source§

impl IncompleteCholesky

Source

pub fn ic0(a: &CsrMatrix) -> Result<IncompleteCholesky>

IC(0): the factor has exactly the sparsity pattern of the lower triangle of A. If a pivot turns out non-positive, which can happen even for an SPD matrix, the factorisation is restarted with the diagonal increased to (1 + α) diag(A) for a growing α (Manteuffel’s shift); the shift used is reported by IncompleteCholesky::shift.

Source

pub fn ic0_shifted(a: &CsrMatrix, shift: f64) -> Result<IncompleteCholesky>

IC(0) with a given shift α ≥ 0 and no retry: fails with LinalgError::NotPositiveDefinite if a pivot is not positive.

Source

pub fn ic_k( a: &CsrMatrix, level: usize, modified: bool, ) -> Result<IncompleteCholesky>

IC(k): the factor keeps the entries whose level of fill is at most level. Entries of A have level 0, and an entry created by eliminating column j from entries of levels a and b has level a + b + 1; IC(0) is IncompleteCholesky::ic0, and a large level gives the exact factor. With modified, every update that is dropped is subtracted from the two diagonal entries it would have changed (MIC, Gustafsson 1978), so that L Lᵀ has the row sums of A (up to the shift): this improves the condition number of the preconditioned system of a Laplacian-like matrix from O(h⁻²) to O(h⁻¹). The elimination is right-looking, because the compensation changes diagonals that are not yet used. A failing pivot restarts with a shift, as for IncompleteCholesky::ic0.

Source

pub fn ict( a: &CsrMatrix, drop_tol: f64, max_fill: usize, ) -> Result<IncompleteCholesky>

The threshold version, ICT(τ, p): fill is allowed, but every entry of row i smaller than τ ‖aᵢ‖₂ is dropped, and only the p largest entries of each row are kept (the diagonal always). With τ = 0 and a large p it is the exact Cholesky factor.

Source

pub fn ordered( a: &CsrMatrix, ordering: IcOrdering, factor: impl FnOnce(&CsrMatrix) -> Result<IncompleteCholesky>, ) -> Result<IncompleteCholesky>

The factorisation of P A Pᵀ for the ordering P chosen by ordering, with factor (for example |m| IncompleteCholesky::ic_k(m, 1, false)); IncompleteCholesky::solve applies the permutation, so the result is used exactly like an unordered factor. Ordering helps ICT and IC(k) most; IC(0) keeps the pattern of A, which an ordering changes.

Source

pub fn solve(&self, b: &[f64]) -> Vec<f64>

Solves L Lᵀ x = b by forward and back substitution (with the permutation, if the factor was made by IncompleteCholesky::ordered).

Source

pub fn nnz(&self) -> usize

The stored entries of L, diagonal included.

Source

pub fn shift(&self) -> f64

The diagonal shift α of the factorised matrix A + α diag(A).

Trait Implementations§

Source§

impl Clone for IncompleteCholesky

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IncompleteCholesky

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl LinearOperator for IncompleteCholesky

As a preconditioner, M = (L Lᵀ)⁻¹.

Source§

fn shape(&self) -> (usize, usize)

(rows, columns).
Source§

fn matvec(&self, x: &[f64]) -> Vec<f64>

A x.
Source§

fn rmatvec(&self, x: &[f64]) -> Vec<f64>

Aᵀ x (needed by LSQR).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.