function ipd = is_positive_definite(A) % Returns true if A is positive-definite, and false otherwise. We % perform a full Cholesky factorization, so this is not fast. ipd = false; [R,p] = chol(A); if (p == 0) % The error flag is not set. ipd = true; end end