Пример #1
0
 def test_list(self):
     assert_array_equal(matrix_power([[0, 1], [0, 0]], 2), [[0, 0], [0, 0]])
Пример #2
0
 def test_returntype(self):
     a = np.array([[0, 1], [0, 0]])
     assert_(type(matrix_power(a, 2)) is np.ndarray)
     a = mat(a)
     assert_(type(matrix_power(a, 2)) is matrix)
Пример #3
0
 def test_returntype(self):
     a = array([[0, 1], [0, 0]])
     assert type(matrix_power(a, 2)) is ndarray
     a = mat(a)
     assert type(matrix_power(a, 2)) is matrix
Пример #4
0
 def test_list(self):
     assert_array_equal(matrix_power([[0, 1], [0, 0]], 2), [[0, 0], [0, 0]])
Пример #5
0
 def test_returntype(self):
     a = array([[0,1],[0,0]])
     assert_(type(matrix_power(a, 2)) is ndarray)
     a = mat(a)
     assert_(type(matrix_power(a, 2)) is matrix)
Пример #6
0
 def M(self, t, nu):
     '''Two-level method''s symbol with nu pre-relaxations per cycle.'''
     return (np.eye(2) - self.P(t) * (1. / (self.ac(t))) * self.R(t) * self.A(t)) * matrix_power(self.S(t), nu) 
Пример #7
0
def M(t, nu):
    '''Two-level method''s symbol with nu pre-relaxations per cycle.'''
    return (np.eye(sum(1 for _ in harmonics(t))) - P(t) * inv(Ac(t)) * R(t) * A(t)) * matrix_power(S(t), nu) 
Пример #8
0
 def M(self, t, nu):
     '''Two-level method''s symbol with nu pre-relaxations per cycle.'''
     return (np.eye(2) - self.P(t) * (1. / (self.ac(t))) * self.R(t) * self.A(t)) * matrix_power(self.S(t), nu)