def test_inv2(self): a = [[2, 2, 0, 2], [4, 0, -4, -4], [0, -8, -8, 8], [16, -16, 16, -0]] b = matrix_inv.inv(a) c = matrix_inv.mult_square(a, b) d = matrix_inv.ident(4) self.assertEqual(c, d)
def test_inv1(self): a = [[1, 1, 1, 1], [1, 1, -1, -1], [1, -1, -1, 1], [1, -1, 1, -1]] b = matrix_inv.inv(a) c = matrix_inv.mult_square(a, b) d = matrix_inv.ident(4) self.assertEqual(c, d)
def test_inv3(self): a = matrix_inv.ident(4) b = matrix_inv.inv(a) self.assertEqual(a, b)
def test_det4(self): a = matrix_inv.ident(4) d = matrix_inv.det(a) self.assertEqual(d, 1)
def test_ident(self): a = matrix_inv.ident(4) aa = matrix_inv.mult_square(a, a) self.assertEqual(aa, a)