extendr_api::prelude::modules::cholesky::ldlt_diagonal::compute

Function raw_cholesky_in_place

pub fn raw_cholesky_in_place<E>(
    matrix: MatMut<'_, E>,
    regularization: LdltRegularization<'_, E>,
    parallelism: Parallelism<'_>,
    stack: PodStack<'_>,
    params: LdltDiagParams,
) -> LdltInfo
where E: ComplexField,
Expand description

Computes the Cholesky factors $L$ and $D$ of the input matrix such that $L$ is strictly lower triangular, $D$ is real-valued diagonal, and $$LDL^H = A.$$

The result is stored back in the same matrix.

The input matrix is interpreted as Hermitian with the values being extracted from the lower part, but the entire matrix is required to be initialized.

The matrix $L$ is stored in the strictly lower triangular part of the input matrix, and the diagonal elements of $D$ are stored on the diagonal.

The strictly upper triangular part of the matrix is clobbered and may be filled with garbage values.

§Warning

The Cholesky decomposition with diagonal may have poor numerical stability properties when used with non positive definite matrices. In the general case, it is recommended to first permute (and conjugate when necessary) the rows and columns of the matrix using the permutation obtained from faer::linalg::cholesky::compute_cholesky_permutation.

§Panics

Panics if the input matrix is not square.

This can also panic if the provided memory in stack is insufficient (see raw_cholesky_in_place_req).