Exemplo n.º 1
0
def test_dup_gff_list():
    f = [1, 2, -1, -2, 0, 0]

    assert dup_gff_list(f, ZZ) == [([1, 0], 1), ([1, 2], 4)]

    g = [1, -20, 166, -744, 1965, -3132, 2948, -1504, 320, 0]

    assert dup_gff_list(g, ZZ) == [([1, -5, 4], 1), ([1, -5, 4], 2), ([1, 0], 3)]

    raises(ValueError, "dup_gff_list([], ZZ)")
Exemplo n.º 2
0
 def gff_list(f):
     """Computes greatest factorial factorization of `f`. """
     if not f.lev:
         return [ (f.per(g), k) for g, k in dup_gff_list(f.rep, f.dom) ]
     else:
         raise ValueError('univariate polynomial expected')
Exemplo n.º 3
0
 def gff_list(f):
     """Computes greatest factorial factorization of `f`. """
     if not f.lev:
         return [ (f.per(g), k) for g, k in dup_gff_list(f.rep, f.dom) ]
     else:
         raise ValueError('univariate polynomial expected')