Пример #1
0
def test_dup_zz_hensel_step():
    f = dup_from_raw_dict({4: 1, 0: -1}, ZZ)

    g = dup_from_raw_dict({3: 1, 2: 2, 1: -1, 0: -2}, ZZ)
    h = dup_from_raw_dict({1: 1, 0: -2}, ZZ)
    s = dup_from_raw_dict({0: -2}, ZZ)
    t = dup_from_raw_dict({2: 2, 1: -2, 0: -1}, ZZ)

    G, H, S, T = dup_zz_hensel_step(5, f, g, h, s, t, ZZ)

    assert G == dup_from_raw_dict({3: 1, 2: 7, 1: -1, 0: -7}, ZZ)
    assert H == dup_from_raw_dict({1: 1, 0: -7}, ZZ)
    assert S == dup_from_raw_dict({0: 8}, ZZ)
    assert T == dup_from_raw_dict({2: -8, 1: -12, 0: -1}, ZZ)
Пример #2
0
def test_dup_zz_hensel_step():
    f = dup_from_raw_dict({4:1, 0:-1}, ZZ)

    g = dup_from_raw_dict({3:1, 2:2, 1:-1, 0:-2}, ZZ)
    h = dup_from_raw_dict({1:1, 0:-2}, ZZ)
    s = dup_from_raw_dict({0:-2}, ZZ)
    t = dup_from_raw_dict({2:2, 1:-2, 0:-1}, ZZ)

    G, H, S, T = dup_zz_hensel_step(5, f, g, h, s, t, ZZ)

    assert G == dup_from_raw_dict({3:1, 2:7, 1:-1, 0:-7}, ZZ)
    assert H == dup_from_raw_dict({1:1, 0:-7}, ZZ)
    assert S == dup_from_raw_dict({0:8}, ZZ)
    assert T == dup_from_raw_dict({2:-8, 1:-12, 0:-1}, ZZ)