pub struct CscCholesky<T> { /* private fields */ }Expand description
A sparse Cholesky factorization A = L L^T of a CscMatrix.
The factor L is a sparse, lower-triangular matrix. See the article on Wikipedia for
more information.
The implementation is a port of the CsCholesky implementation in nalgebra. It is similar
to Tim Davis’ CSparse. The current implementation performs no fill-in reduction, and can
therefore be expected to produce much too dense Cholesky factors for many matrices.
It is therefore not currently recommended to use this implementation for serious projects.
Implementations§
Source§impl<T: RealField> CscCholesky<T>
impl<T: RealField> CscCholesky<T>
Sourcepub fn factor_numerical(
symbolic: CscSymbolicCholesky,
values: &[T],
) -> Result<Self, CholeskyError>
pub fn factor_numerical( symbolic: CscSymbolicCholesky, values: &[T], ) -> Result<Self, CholeskyError>
Computes the numerical Cholesky factorization associated with the given symbolic factorization and the provided values.
The values correspond to the non-zero values of the CSC matrix for which the symbolic factorization was computed.
§Errors
Returns an error if the numerical factorization fails. This can occur if the matrix is not symmetric positive definite.
§Panics
Panics if the number of values differ from the number of non-zeros of the sparsity pattern of the matrix that was symbolically factored.
Sourcepub fn factor(matrix: &CscMatrix<T>) -> Result<Self, CholeskyError>
pub fn factor(matrix: &CscMatrix<T>) -> Result<Self, CholeskyError>
Computes the Cholesky factorization of the provided matrix.
The matrix must be symmetric positive definite. Symmetry is not checked, and it is up to the user to enforce this property.
§Errors
Returns an error if the numerical factorization fails. This can occur if the matrix is not symmetric positive definite.
§Panics
Panics if the matrix is not square.
Sourcepub fn refactor(&mut self, values: &[T]) -> Result<(), CholeskyError>
pub fn refactor(&mut self, values: &[T]) -> Result<(), CholeskyError>
Re-computes the factorization for a new set of non-zero values.
This is useful when the values of a matrix changes, but the sparsity pattern remains constant.
§Errors
Returns an error if the numerical factorization fails. This can occur if the matrix is not symmetric positive definite.
§Panics
Panics if the number of values does not match the number of non-zeros in the sparsity pattern.
Sourcepub fn solve<'a>(&'a self, b: impl Into<DMatrixView<'a, T>>) -> DMatrix<T>
pub fn solve<'a>(&'a self, b: impl Into<DMatrixView<'a, T>>) -> DMatrix<T>
Sourcepub fn solve_mut<'a>(&'a self, b: impl Into<DMatrixViewMut<'a, T>>)
pub fn solve_mut<'a>(&'a self, b: impl Into<DMatrixViewMut<'a, T>>)
Solves the system AX = B, where X and B are dense matrices.
The result is stored in-place in b.
§Panics
Panics if b is not square.
Trait Implementations§
Source§impl<T: Clone> Clone for CscCholesky<T>
impl<T: Clone> Clone for CscCholesky<T>
Source§fn clone(&self) -> CscCholesky<T>
fn clone(&self) -> CscCholesky<T>
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> Freeze for CscCholesky<T>
impl<T> RefUnwindSafe for CscCholesky<T>where
T: RefUnwindSafe,
impl<T> Send for CscCholesky<T>where
T: Send,
impl<T> Sync for CscCholesky<T>where
T: Sync,
impl<T> Unpin for CscCholesky<T>where
T: Unpin,
impl<T> UnwindSafe for CscCholesky<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.