I think its already been asked , but still i can't figure out a way to do it computationally,
I had to check for positive definiteness of a matrix $A$ of order $n$ by $n$.I know that for any vector $x$ of order $1$ by $n$ , $x^{t}Ax > 0$,
But the problem is i want to implement it while coding a C++ program for Cholesky method in which i need both 1)Symmetric matrix and 2)Positive definite matrix.
How do i approach this situation,if i go for the definition then it can be computationally inefficient as i have to check for each vector $x$.
Any other method which i can use for Positive - definiteness. ?
Any help is great!
A matrix $A$ is positive definite if and only if the symmetric matrix $M = A + A^T$ is positive definite. You should be able to find a program that attempts a Cholesky decomposition on $M$. If it succeeds, then $A$ is positive semidefinite. If it succeeds and the resulting lower-triangular matrix has only non-zero elements on the diagonal (or a non-square lower-triangular matrix), then $A$ is positive definite. If the Cholesky decomposition fails, then $A$ is not positive semidefinite (and of course, not positive definite).
Note: The above is a standard method for checking whether a matrix is positive definite. While this method is fine in the "general case", it is liable to yield false positives/negatives in the case that $A$ is close to being (or is) singular. See the other answer (and the linked extension) for a more thorough discussion of these "edge cases".
About $A + A^T$: note that for any $x$, we have $$ 2(x^TAx) = x^T(Ax) + (Ax)^Tx = x^TAx + x^TA^Tx = x^T(A + A^T)x $$ clearly, $x^TAx$ will be positive (or non-negative) if and only if $x^T(A + A^T)x$ is positive (or non-negative).