scipy.linalg.cho_factor

scipy.linalg.cho_factor(a, lower=False, overwrite_a=False)[source]

Compute the Cholesky decomposition of a matrix, to use in cho_solve

Returns a matrix containing the Cholesky decomposition, A = L L* or A = U* U of a Hermitian positive-definite matrix a. The return value can be directly used as the first parameter to cho_solve.

Warning

The returned matrix also contains random data in the entries not used by the Cholesky decomposition. If you need to zero these entries, use the function cholesky instead.

Parameters :

a : array, shape (M, M)

Matrix to be decomposed

lower : boolean

Whether to compute the upper or lower triangular Cholesky factorization (Default: upper-triangular)

overwrite_a : boolean

Whether to overwrite data in a (may improve performance)

Returns :

c : array, shape (M, M)

Matrix whose upper or lower triangle contains the Cholesky factor of a. Other parts of the matrix contain random data.

lower : boolean

Flag indicating whether the factor is in the lower or upper triangle

Raises :

LinAlgError :

Raised if decomposition fails.

See also

cho_solve
Solve a linear set equations using the Cholesky factorization of a matrix.

Previous topic

scipy.linalg.cholesky_banded

Next topic

scipy.linalg.cho_solve