Skip to content

chol

builtin · libnexusinterp/corefcn/chol-proprietary.cc

: R = chol (A)
: L = chol (A, "lower")
: [R, p] = chol (A)
: [R, p, S] = chol (A)
: [R, p, s] = chol (A, "vector")

Cholesky factorization of a Hermitian positive definite matrix.

R = chol (A) returns the upper triangular R with R' * R = A; only the upper triangle of A is read. With the "lower" option the lower triangular L with L * L' = A is returned and only the lower triangle is read.

With two outputs no error is raised for a matrix that is not positive definite: p is zero for a positive definite matrix and otherwise the index of the failing pivot. For dense A, R is the factor of the leading (p-1)-by-(p-1) block; for sparse A, R is (p-1)-by-n.

For a sparse A a third output returns a fill-reducing permutation, as a matrix S (R' * R = S' * A * S) or, with the "vector" option, as a vector s (R' * R = A(s,s)).