def test_list(self): assert_array_equal(matrix_power([[0, 1], [0, 0]], 2), [[0, 0], [0, 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)
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
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)
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)
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)