Compute the Cholesky factor, r, of the symmetric positive definite matrix a, where
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 andchol
does not fail. A zero value indicated that the matrix was positive definite and the r gives the factorization, annd 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 thatThe sparsity preserving permutation is generally returned as a matrix. However, given the flag 'vector', q will be returned as a vector such that
Called with either a sparse or full matrix and uing the 'lower' flag,
chol
returns the lower triangular factorization such thatIn general the lower trinagular factorization is significantly faster for sparse matrices.