[Math] If A is symmetric positive definite, is -A symmetric negative definite and why

matrices

I ask this because I'm programming a function that does only take a symmetric positive definite matrix as input.
But now I'm told give to the function the negation of such a matrix. That makes no sense to me, because I think it's negative definite then.

To check for a matrix to be symmetric positive definite,
does it suffice to check, that it is symmetric and then to check that all its real eigenvalues are positive?

Best Answer

If $x^TAx>0$ for all $x\neq 0$, then $x^T(-A)x=-x^TAx<0$ for all $x\neq 0$. So yes, if $A$ is symmetric positive definite, then $-A$ is (symmetric) negative definite.

The cheapest way how to check whether a symmetric matrix is positive definite is to compute the $LDL^T$ factorization of $A$. If all the pivots on the diagonal of $D$ are positive, then $A$ is SPD. This test is much cheaper than to compute all the eigenvalues of $A$.