예제 #1
0
def test_gm_1_3():
    # according to https://en.wikipedia.org/wiki/Reed%E2%80%93Muller_code
    # but shuffling the columns to read left to right.
    correct = """
    11111111
    01010101
    00110011
    00001111
    """
    gm = reed_muller(1, 3)
    assert (gm == _cm(correct)).all()
예제 #2
0
def test_gm_invalid_values():
    with pytest.raises(ValueError):
        reed_muller(0, 1)
        reed_muller(0, 0)
        reed_muller(-2, -1)
        reed_muller(10, 9)
예제 #3
0
def test_gm_shape():
    gm = reed_muller(1, 9)
    assert gm.shape == (9 + 1, 2 ** 9)
예제 #4
0
def test_gm_smallest():
    gm = reed_muller(1, 1)
    assert (gm == _cm("11 01")).all()