Function navtk::chol

Function Documentation

Matrix navtk::chol(const Matrix &matrix)

Calculate the Cholesky decomposition of a matrix.

Parameters

matrix – A square matrix (NxN).

Throws

std::runtime_error – If A is non-square or contains a negative element along diagonal and the error mode is ErrorMode::DIE.

Returns

Lower triangular Cholesky Matrix, same size as A. Though, if A is singular (zero determinant) then return the square root of the main diagonal elements.