How can I find out if a matrix is positive definite?
My matrix is a NumPy matrix. I was expecting to find any related method in the NumPy library, but I didn't have any success.
You can also check if all the eigenvalues of matrix are positive. If so, the matrix is positive definite:
import numpy as np
def is_pos_def(x):
return np.all(np.linalg.eigvals(x) > 0)