コード例 #1
0
def test_fateman_poly_F_2():
    f,g,h = fateman_poly_F_2(1)
    F,G,H = zzX_fateman_poly_F_2(1)

    assert map(zzX_from_poly, [f,g,h]) == [F,G,H]

    f,g,h = fateman_poly_F_2(3)
    F,G,H = zzX_fateman_poly_F_2(3)

    assert map(zzX_from_poly, [f,g,h]) == [F,G,H]
コード例 #2
0
def test_zzX_heu_gcd():
    f,g,h = zzX_fateman_poly_F_1(2)
    H, cff, cfg = zzX_heu_gcd(f, g)

    assert H == h and zzX_mul(H, cff) == f \
                  and zzX_mul(H, cfg) == g

    f,g,h = zzX_fateman_poly_F_1(4)
    H, cff, cfg = zzX_heu_gcd(f, g)

    assert H == h and zzX_mul(H, cff) == f \
                  and zzX_mul(H, cfg) == g

    f,g,h = zzX_fateman_poly_F_1(6)
    H, cff, cfg = zzX_heu_gcd(f, g)

    assert H == h and zzX_mul(H, cff) == f \
                  and zzX_mul(H, cfg) == g

    f,g,h = zzX_fateman_poly_F_2(2)
    H, cff, cfg = zzX_heu_gcd(f, g)

    assert H == h and zzX_mul(H, cff) == f \
                  and zzX_mul(H, cfg) == g

    f,g,h = zzX_fateman_poly_F_3(2)
    H, cff, cfg = zzX_heu_gcd(f, g)

    assert H == h and zzX_mul(H, cff) == f \
                  and zzX_mul(H, cfg) == g

    f,g,h = zzX_fateman_poly_F_1(8)

    H, cff, cfg = zzX_heu_gcd(f, g)

    assert H == h and zzX_mul(H, cff) == f \
                  and zzX_mul(H, cfg) == g