Skip to content

num::linear::is_spd

Defined in header <linear/factorization/cholesky.hpp>

bool is_spd(const mat<real> &A, real tol = 1e-12);

Test symmetry and positive definiteness by a Cholesky factorization, which fails exactly when a pivot is not positive.

The raw-pointer overload is used because the mat overload of num::cholesky requires the invariant being tested.