Пример #1
0
 def test_submatrix_of_4x4_is_3x3(self):
     a = Matrix([[-6, 1, 1, 6], [-8, 5, 8, 6], [-1, 0, 8, 2],
                 [-7, 1, -1, 1]])
     assert a.submatrix(2, 1) == Matrix([[-6, 1, 6], [-8, 8, 6],
                                         [-7, -1, 1]])
Пример #2
0
 def test_minor_of_3x3(self):
     a = Matrix([[3, 5, 0], [2, -1, -7], [6, -1, 5]])
     b = a.submatrix(1, 0)
     assert b.determinant() == 25
     assert a.minor(1, 0) == 25
Пример #3
0
 def test_submatrix_of_3x3_is_2x2(self):
     a = Matrix([[1, 5, 0], [-3, 2, 7], [0, 6, -3]])
     assert a.submatrix(0, 2) == Matrix([[-3, 2], [0, 6]])