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)
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)