#NEWLINE# def testcompare( m1 , m2 ) : #NEWLINE# #INDENT# from numpy.testing import assert_almost_equal , assert_approx_equal #NEWLINE# decimal = 12 #NEWLINE# assert_almost_equal ( m1 . minv , evecs1 . minv , decimal = decimal ) #NEWLINE# s1 = np . sign ( m1 . mhalf . sum ( 1 ) ) [ : , None ] #NEWLINE# s2 = np . sign ( m2 . mhalf . sum ( 1 ) ) [ : , None ] #NEWLINE# scorr = ( s1 / s2 ) #NEWLINE# assert_almost_equal ( m1 . mhalf , ( m2 . mhalf * scorr ) , decimal = decimal ) #NEWLINE# assert_almost_equal ( m1 . minvhalf , m2 . minvhalf , decimal = decimal ) #NEWLINE# ( evals1 , evecs1 ) = m1 . meigh #NEWLINE# ( evals2 , evecs2 ) = m2 . meigh #NEWLINE# assert_almost_equal ( evals1 , evals2 , decimal = decimal ) #NEWLINE# s1 = np . sign ( evecs1 . sum ( 0 ) ) #NEWLINE# s2 = np . sign ( evecs2 . sum ( 0 ) ) #NEWLINE# scorr = ( s1 / s2 ) #NEWLINE# assert_almost_equal ( evecs1 , ( evecs2 * scorr ) , decimal = decimal ) #NEWLINE# assert_approx_equal ( m1 . mdet , m2 . mdet , significant = 13 ) #NEWLINE# assert_approx_equal ( m1 . mlogdet , m2 . mlogdet , significant = 13 )