示例#1
0
def test_reblock_2x2():
    B = BlockMatrix([[MatrixSymbol(f'A_{i:d}{j:d}', 2, 2) for j in range(3)]
                     for i in range(3)])
    assert B.blocks.shape == (3, 3)

    BB = reblock_2x2(B)
    assert BB.blocks.shape == (2, 2)

    assert B.shape == BB.shape
    assert B.as_explicit() == BB.as_explicit()
示例#2
0
def test_reblock_2x2():
    B = BlockMatrix([[MatrixSymbol('A_%d%d' % (i, j), 2, 2)
                      for j in range(3)]
                     for i in range(3)])
    assert B.blocks.shape == (3, 3)

    BB = reblock_2x2(B)
    assert BB.blocks.shape == (2, 2)

    assert B.shape == BB.shape
    assert B.as_explicit() == BB.as_explicit()
示例#3
0
def test_deblock():
    B = BlockMatrix([[MatrixSymbol(f'A_{i:d}{j:d}', n, n) for j in range(4)]
                     for i in range(4)])

    assert deblock(reblock_2x2(B)) == B
示例#4
0
def test_deblock():
    B = BlockMatrix([[MatrixSymbol('A_%d%d' % (i, j), n, n) for j in range(4)]
                     for i in range(4)])

    assert deblock(reblock_2x2(B)) == B
示例#5
0
def test_deblock():
    B = BlockMatrix([[MatrixSymbol('A_%d%d' % (i, j), n, n)
                      for j in range(4)]
                     for i in range(4)])

    assert deblock(reblock_2x2(B)) == B