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