Ejemplo n.º 1
0
def test_fateman_poly_F_2():
    f, g, h = map(lambda x: x.rep.to_dense(), fateman_poly_F_2(1))

    assert f == [[1], [-2], [-2, -6, -3], [2, 6, 4], [1, 6, 13, 12, 4]]
    assert g == [[1], [4, 6], [6, 18, 13], [4, 18, 26, 12], [1, 6, 13, 12, 4]]
    assert h == [[1], [2, 2], [1, 2, 1]]

    f, g, h = map(lambda x: x.rep.to_dense(), fateman_poly_F_2(3))

    assert f == [[[[1]]], [[[-2]]], [[[-2]], [[-4], [-4, -6]],
                                     [[-2], [-4, -6], [-2, -6, -3]]],
                 [[[2]], [[4], [4, 6]], [[2], [4, 6], [2, 6, 4]]],
                 [[[1]], [[4], [4, 6]], [[6], [12, 18], [6, 18, 13]],
                  [[4], [12, 18], [12, 36, 26], [4, 18, 26, 12]],
                  [[1], [4, 6], [6, 18, 13], [4, 18, 26, 12],
                   [1, 6, 13, 12, 4]]]]
    assert g == [[[[1]]], [[[4]], [[4], [4, 6]]],
                 [[[6]], [[12], [12, 18]], [[6], [12, 18], [6, 18, 13]]],
                 [[[4]], [[12], [12, 18]], [[12], [24, 36], [12, 36, 26]],
                  [[4], [12, 18], [12, 36, 26], [4, 18, 26, 12]]],
                 [[[1]], [[4], [4, 6]], [[6], [12, 18], [6, 18, 13]],
                  [[4], [12, 18], [12, 36, 26], [4, 18, 26, 12]],
                  [[1], [4, 6], [6, 18, 13], [4, 18, 26, 12],
                   [1, 6, 13, 12, 4]]]]
    assert h == [[[[1]]], [[[2]], [[2], [2, 2]]],
                 [[[1]], [[2], [2, 2]], [[1], [2, 2], [1, 2, 1]]]]
Ejemplo n.º 2
0
def test_fateman_poly_F_2():
    f, g, h = fateman_poly_F_2(1)
    F, G, H = dmp_fateman_poly_F_2(1, ZZ)

    assert [t.rep.rep for t in [f, g, h]] == [F, G, H]

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

    assert [t.rep.rep for t in [f, g, h]] == [F, G, H]
Ejemplo n.º 3
0
def test_fateman_poly_F_2():
    f, g, h = fateman_poly_F_2(1)
    F, G, H = dmp_fateman_poly_F_2(1, ZZ)

    assert [ t.rep.rep for t in [f, g, h] ] == [F, G, H]

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

    assert [ t.rep.rep for t in [f, g, h] ] == [F, G, H]