def _logdet(A):
 vals = linalg.eigh(A)[0]
 tol = ((vals.max() * vals.size) * np.finfo(np.float64).eps)
 vals = np.where((vals > tol), vals, tol)
 return np.sum(np.log(vals))

def _logdet ( A ) : vals = linalg . eigh ( A ) [ 0 ] tol = ( ( vals . max ( ) * vals . size ) * np . finfo ( np . float64 ) . eps ) vals = np . where ( ( vals > tol ) , vals , tol ) return np . sum ( np . log ( vals ) )
compute the log det of a symmetric matrix .