def testPowerEigs(self): 
        n = 10 
        numRuns = 10 
        
        for i in range(numRuns): 
            A = numpy.random.rand(n, n)
            
            l, v = Util.powerEigs(A, 0.001)
            nptst.assert_array_almost_equal(v*l, A.dot(v), 2)
            
            u, V = numpy.linalg.eig(A)
            self.assertAlmostEquals(numpy.max(u), l, 2)
            
            try: 
                nptst.assert_array_almost_equal(V[:, 0], v, 2)
            except __HOLE__: 
                nptst.assert_array_almost_equal(V[:, 0], -v, 2)
dataset/ETHPy150Open charanpald/APGL/apgl/util/test/UtilTest.py/UtilTest.testPowerEigs