def test_3x3_sub(): m = Matrix([[-6, 1, 1, 6], [-8, 5, 8, 6], [-1, 0, 8, 2], [-7, 1, -1, 1]]) sub = m.sub(2, 1) assert sub == Matrix([[-6, 1, 6], [-8, 8, 6], [-7, -1, 1]])
def test_minor(): m = Matrix([[3, 5, 0], [2, -1, -7], [6, -1, 5]]) b = m.sub(1, 0) assert b.determinant() == 25 assert m.minor(1, 0) == 25
def test_2x2_sub(): m = Matrix([[1, 5, 0], [-3, 2, 7], [0, 6, -3]]) sub = m.sub(0, 2) assert sub == Matrix([[-3, 2], [0, 6]])