factorize

CholeskyFactor.factorize(A, ldl=None, beta=0.0)[source]

Compute the numerical Cholesky factorization of a sparse matrix.

This method computes the numerical values of \(P A P^{\top} = R^{\top} R\) or \(P A P^{\top} = L L^{\top}\) decomposition of a Hermitian positive-definite matrix A, with fill-reducing permutation P.

Parameters:
  • A ((N, N) {array_like, sparse array}) – An array convertible to a sparse matrix in Compressed Sparse Column (CSC) format. The matrix must be square and symmetric positive definite. Only the upper or lower triangular part of the matrix is used, and no check is made for symmetry. This matrix can be numericaly different from the matrix used to initialize the CholeskyFactor object, but it must have the same sparsity pattern.

  • ldl (bool, optional) – If True, compute the LDL factorization instead of the Cholesky factorization. Default is None, which uses the same type of factorization as the previous call to factorize(), or False if this is the first call.

  • beta (float, optional) – The scalar value to add to the diagonal of the matrix before factorization. Default is 0.

Notes

If ldl=False, this function computes the Cholesky factorization of a symmetric positive definite matrix A:

\[R^{\top} R = P A P^{\top},\]

where R is an upper triangular matrix. Only the upper triangular part of A is used. If self.is_lower is True, the lower triangular factor L is computed instead, such that:

\[L L^{\top} = P A P^{\top}.\]

In this case, only the lower triangular part of A is used.

If ldl=True, compute the factorization:

\[R^{\top} D R = P A P^{\top},\]

or

\[L D L^{\top} = P A P^{\top},\]

respectively.

If beta is not None, the factorization is computed for the matrix:

\[P A P^{\top} + \beta I.\]

Note that if the CholeskyFactor was initialized with sym_kind equal to "row" or "col", the factorization is computed for \(P A A^{\top} P^{\top}\) or \(P A^{\top} A P^{\top}\), respectively. Similarly, beta is added to the diagonal of these matrices.