Module ndarray_linalg::cholesky
[−]
[src]
Cholesky decomposition of Hermitian (or real symmetric) positive definite matrices
See the Wikipedia page about Cholesky decomposition for more information.
Example
Using the Cholesky decomposition of A
for various operations, where A
is a Hermitian (or real symmetric) positive definite matrix:
#[macro_use] extern crate ndarray; extern crate ndarray_linalg; use ndarray::prelude::*; use ndarray_linalg::cholesky::*; let a: Array2<f64> = array![ [ 4., 12., -16.], [ 12., 37., -43.], [-16., -43., 98.] ]; // Obtain `L` let lower = a.cholesky(UPLO::Lower).unwrap(); assert!(lower.all_close(&array![ [ 2., 0., 0.], [ 6., 1., 0.], [-8., 5., 3.] ], 1e-9)); // Find the determinant of `A` let det = a.detc().unwrap(); assert!((det - 36.).abs() < 1e-9); // Solve `A * x = b` let b = array![4., 13., -11.]; let x = a.solvec(&b).unwrap(); assert!(x.all_close(&array![-2., 1., 0.], 1e-9));
Reexports
pub use lapack_traits::UPLO; |
Structs
CholeskyFactorized |
Cholesky decomposition of Hermitian (or real symmetric) positive definite matrix |
Traits
Cholesky |
Cholesky decomposition of Hermitian (or real symmetric) positive definite matrix reference |
CholeskyInplace |
Cholesky decomposition of Hermitian (or real symmetric) positive definite mutable reference of matrix |
CholeskyInto |
Cholesky decomposition of Hermitian (or real symmetric) positive definite matrix |
DeterminantC |
Determinant of Hermitian (or real symmetric) positive definite matrix ref |
DeterminantCInto |
Determinant of Hermitian (or real symmetric) positive definite matrix |
FactorizeC |
Cholesky decomposition of Hermitian (or real symmetric) positive definite matrix reference |
FactorizeCInto |
Cholesky decomposition of Hermitian (or real symmetric) positive definite matrix |
InverseC |
Inverse of Hermitian (or real symmetric) positive definite matrix ref |
InverseCInto |
Inverse of Hermitian (or real symmetric) positive definite matrix |
SolveC |
Solve systems of linear equations with Hermitian (or real symmetric) positive definite coefficient matrices |