Exemplo n.º 1
0
def test_collapse_to_one_poly():
    IntMod.modulus = 5
    p = PolyMod([
        IntMod(1),
        IntMod(0),
        IntMod(0),
        IntMod(0),
        IntMod(0),
        IntMod(0),
        IntMod(0)
    ])
    p.collapse_degree()

    expected_p = PolyMod([IntMod(1)])

    assert p == expected_p
Exemplo n.º 2
0
def test_collapse_degree_all_zeros():
    IntMod.modulus = 5
    p = PolyMod([
        IntMod(0),
        IntMod(0),
        IntMod(0),
        IntMod(0),
        IntMod(0),
        IntMod(0),
        IntMod(0)
    ])
    p.collapse_degree()

    expected_p = PolyMod([IntMod(0)])

    assert p == expected_p