示例#1
0
def test_Complete():
    A = [[-3, -25], [-1, -16]]
    B = [[3, 5], [1, 6]]
    C = strassens.matrixMultiplication(A, B)
    assert C[0][0] == -34
    assert C[0][1] == -165
    assert C[1][0] == -19
    assert C[1][1] == -101
示例#2
0
def test_returnedSize():
    n = random.randrange(0, 50, 1)
    randomMatrix = [[0 for x in range(n)] for x in range(n)]
    result = strassens.matrixMultiplication(randomMatrix, randomMatrix)
    assert len(result) == n
    assert len(result[0]) == n
示例#3
0
def test_differentSizeInputsException():
    A = [[-3, -25, -2], [-1, -16, 1]]
    B = [[3, 5], [1, 6]]
    with pytest.raises(ValueError):
        strassens.matrixMultiplication(A, B)