Test whether a matrix is positive definite by computing its eigen values.
This function was taken from a package corpcor.
corpcor