Ejemplo n.º 1
0
def test_matrix_submatrix_4x4():
    A = Matrix([[-6, 1, 1, -6], [3, 2, 5, 1], [2, 1, -2, 3], [1, 5, 2, 7]])
    a = A.submatrix(0, 3)

    assert a.n == 3 and a.m == 3
    assert a == Matrix([[3, 2, 5], [2, 1, -2], [1, 5, 2]])
Ejemplo n.º 2
0
def test_matrix_minor_3x3():
    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
Ejemplo n.º 3
0
def test_matrix_submatrix_3x3():
    A = Matrix([[1, 5, 0], [-3, 2, 7], [0, 6, -3]])
    a = A.submatrix(0, 2)
    assert a.n == 2 and a.m == 2
    assert a == Matrix([[-3, 2], [0, 6]])