def _is_pos_def(self, A):
if allclose(A, A.T, rtol=<NUM_LIT>, atol=<NUM_LIT>):<EOL><INDENT>try:<EOL><INDENT>cholesky(A)<EOL>return True<EOL><DEDENT>except LinAlgError:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
Check if matrix A is positive definite. Code from
https://stackoverflow.com/questions/16266720/find-out-if-matrix-is-positive-definite-with-numpy