Example #1
2
 def test_large_power(self):
     assert_equal(matrix_power(self.R90,2L**100+2**10+2**5+1),self.R90)
Example #2
2
 def tz(M):
     mz = matrix_power(M,0)
     assert_equal(mz, identity(M.shape[0]))
     assert_equal(mz.dtype, M.dtype)
Example #3
1
 def check_square(self):
     A = array([[True,False],[True,True]])
     assert_equal(matrix_power(A,2),A)
Example #4
1
 def test_invert_noninvertible(self):
     import numpy.linalg
     self.assertRaises(numpy.linalg.linalg.LinAlgError,
             lambda: matrix_power(self.noninv,-1))
Example #5
1
 def tz(M):
     mz = matrix_power(M,1)
     assert_equal(mz, M)
     assert_equal(mz.dtype, M.dtype)
Example #6
1
 def test_large_power_trailing_zero(self):
     assert_equal(matrix_power(self.R90,2L**100+2**10+2**5),identity(2))
Example #7
0
 def tz(M):
     mz = matrix_power(M,-1)
     assert_almost_equal(identity(M.shape[0]), dot(mz,M))
Example #8
0
 def tz(M):
     mz = matrix_power(M,2)
     assert_equal(mz, dot(M,M))
     assert_equal(mz.dtype, M.dtype)
Example #9
0
 def check_square(self):
     A = array([[True, False], [True, True]])
     assert_equal(matrix_power(A, 2), A)
Example #10
0
 def test_invert_noninvertible(self):
     import numpy.linalg
     self.assertRaises(numpy.linalg.linalg.LinAlgError,
                       lambda: matrix_power(self.noninv, -1))
Example #11
0
 def tz(M):
     mz = matrix_power(M, -1)
     assert_almost_equal(identity(M.shape[0]), dot(mz, M))
Example #12
0
 def tz(M):
     mz = matrix_power(M, 2)
     assert_equal(mz, dot(M, M))
     assert_equal(mz.dtype, M.dtype)
Example #13
0
 def tz(M):
     mz = matrix_power(M, 1)
     assert_equal(mz, M)
     assert_equal(mz.dtype, M.dtype)
Example #14
0
 def tz(M):
     mz = matrix_power(M, 0)
     assert_equal(mz, identity(M.shape[0]))
     assert_equal(mz.dtype, M.dtype)