Navigation

Operators and Keywords

Function List:

C++ API

Loadable Function: R = chol (A)
Loadable Function: [R, p] = chol (A)
Loadable Function: [R, p, Q] = chol (S)
Loadable Function: [R, p, Q] = chol (S, "vector")
Loadable Function: [L, …] = chol (…, "lower")
Loadable Function: [L, …] = chol (…, "upper")

Compute the Cholesky factor, R, of the symmetric positive definite matrix A.

The Cholesky factor is defined by

R' * R = A.

Called with one output argument chol fails if A or S is not positive definite. With two or more output arguments p flags whether the matrix was positive definite and chol does not fail. A zero value indicated that the matrix was positive definite and the R gives the factorization, and p will have a positive value otherwise.

If called with 3 outputs then a sparsity preserving row/column permutation is applied to A prior to the factorization. That is R is the factorization of A(Q,Q) such that

R' * R = Q' * A * Q.

The sparsity preserving permutation is generally returned as a matrix. However, given the flag "vector", Q will be returned as a vector such that

R' * R = A(Q, Q).

Called with either a sparse or full matrix and using the "lower" flag, chol returns the lower triangular factorization such that

L * L' = A.

For full matrices, if the "lower" flag is set only the lower triangular part of the matrix is used for the factorization, otherwise the upper triangular part is used.

In general the lower triangular factorization is significantly faster for sparse matrices.

See also: hess, lu, qr, qz, schur, svd, ichol, cholinv, chol2inv, cholupdate, cholinsert, choldelete, cholshift.

Package: octave