Factor a symmetric positive-definite matrix into L·Lᵀ with definiteness verification.
Cholesky decomposition factors a symmetric positive-definite matrix A into L·Lᵀ where L is lower triangular with positive diagonal entries. It is twice as efficient as LU decomposition and is widely used in statistics (covariance matrices), optimisation, and numerical simulations. The matrix must be both symmetric and positive-definite; otherwise the decomposition fails.
Cholesky Factorisation
A = L·Lᵀ
Diagonal Element
Lⱼⱼ = √(Aⱼⱼ − Σₖ₌₁ʲ⁻¹ Lⱼₖ²)
A symmetric matrix A is positive-definite if xᵀAx > 0 for all non-zero vectors x. Equivalently, all its eigenvalues are positive.
The algorithm encounters a non-positive value under the square root and reports an error. This is a definitive test for positive-definiteness.