Changeset 0ebf2c in git


Ignore:
Timestamp:
Dec 16, 2013, 4:49:14 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
45e4745a608922f7284295282b6493fae5341626
Parents:
2773fe426f803fdb541ac43df1e156eb4069affc
git-author:
Martin Lee <martinlee84@web.de>2013-12-16 16:49:14+01:00
git-committer:
Martin Lee <martinlee84@web.de>2014-01-20 16:45:03+01:00
Message:
chg: second part of changes to facMul.cc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facMul.cc

    r2773fe r0ebf2c  
    10981098  int degAy= degree (A);
    10991099  nmod_poly_init2 (result, getCharacteristic(), d*(degAy + 1));
     1100  _nmod_poly_set_length (result, d*(degAy + 1));
     1101  flint_mpn_zero (result->coeffs, d*(degAy+1));
    11001102
    11011103  nmod_poly_t buf;
    11021104
    1103   int j, k, bufRepLength;
     1105  int k;
    11041106  for (CFIterator i= A; i.hasTerms(); i++)
    11051107  {
    11061108    convertFacCF2nmod_poly_t (buf, i.coeff());
    1107 
    11081109    k= i.exp()*d;
    1109     bufRepLength= (int) nmod_poly_length (buf);
    1110     for (j= 0; j < bufRepLength; j++)
    1111       nmod_poly_set_coeff_ui (result, j + k, nmod_poly_get_coeff_ui (buf, j));
     1110    flint_mpn_copyi (result->coeffs+k, buf->coeffs, nmod_poly_length(buf));
     1111
    11121112    nmod_poly_clear (buf);
    11131113  }
    11141114  _nmod_poly_normalise (result);
    11151115}
     1116
     1117#if (__FLINT_VERSION_MINOR >= 4)
     1118void
     1119kronSubFq (fq_nmod_poly_t result, const CanonicalForm& A, int d,
     1120           const fq_nmod_ctx_t fq_con)
     1121{
     1122  int degAy= degree (A);
     1123  fq_nmod_poly_init2 (result, d*(degAy + 1), fq_con);
     1124  _fq_nmod_poly_set_length (result, d*(degAy + 1), fq_con);
     1125  _fq_nmod_vec_zero (result->coeffs, d*(degAy + 1), fq_con);
     1126
     1127  fq_nmod_poly_t buf1;
     1128
     1129  nmod_poly_t buf2;
     1130
     1131  int k;
     1132
     1133  for (CFIterator i= A; i.hasTerms(); i++)
     1134  {
     1135    if (i.coeff().inCoeffDomain())
     1136    {
     1137      convertFacCF2nmod_poly_t (buf2, i.coeff());
     1138      fq_nmod_poly_init2 (buf1, 1, fq_con);
     1139      fq_nmod_poly_set_coeff (buf1, 0, buf2, fq_con);
     1140      nmod_poly_clear (buf2);
     1141    }
     1142    else
     1143      convertFacCF2Fq_nmod_poly_t (buf1, i.coeff(), fq_con);
     1144
     1145    k= i.exp()*d;
     1146    _fq_nmod_vec_set (result->coeffs+k, buf1->coeffs,
     1147                      fq_nmod_poly_length (buf1, fq_con), fq_con);
     1148
     1149    fq_nmod_poly_clear (buf1, fq_con);
     1150  }
     1151
     1152  _fq_nmod_poly_normalise (result, fq_con);
     1153}
     1154#endif
    11161155
    11171156void kronSubQa (fmpq_poly_t result, const CanonicalForm& A, int d1, int d2)
     
    12001239}
    12011240
     1241#if (__FLINT_VERSION_MINOR >= 4)
     1242void
     1243kronSubReciproFq (fq_nmod_poly_t subA1, fq_nmod_poly_t subA2,
     1244                  const CanonicalForm& A, int d, const fq_nmod_ctx_t fq_con)
     1245{
     1246  int degAy= degree (A);
     1247  fq_nmod_poly_init2 (subA1, d*(degAy + 2), fq_con);
     1248  fq_nmod_poly_init2 (subA2, d*(degAy + 2), fq_con);
     1249
     1250  _fq_nmod_poly_set_length (subA1, d*(degAy + 2), fq_con);
     1251  _fq_nmod_vec_zero (subA1->coeffs, d*(degAy + 2), fq_con);
     1252
     1253  _fq_nmod_poly_set_length (subA2, d*(degAy + 2), fq_con);
     1254  _fq_nmod_vec_zero (subA2->coeffs, d*(degAy + 2), fq_con);
     1255
     1256  fq_nmod_poly_t buf1;
     1257
     1258  nmod_poly_t buf2;
     1259
     1260  int k, kk;
     1261  for (CFIterator i= A; i.hasTerms(); i++)
     1262  {
     1263    if (i.coeff().inCoeffDomain())
     1264    {
     1265      convertFacCF2nmod_poly_t (buf2, i.coeff());
     1266      fq_nmod_poly_init2 (buf1, 1, fq_con);
     1267      fq_nmod_poly_set_coeff (buf1, 0, buf2, fq_con);
     1268      nmod_poly_clear (buf2);
     1269    }
     1270    else
     1271      convertFacCF2Fq_nmod_poly_t (buf1, i.coeff(), fq_con);
     1272
     1273    k= i.exp()*d;
     1274    kk= (degAy - i.exp())*d;
     1275    _fq_nmod_vec_add (subA1->coeffs+k, subA1->coeffs+k, buf1->coeffs,
     1276                      fq_nmod_poly_length(buf1, fq_con), fq_con);
     1277    _fq_nmod_vec_add (subA2->coeffs+kk, subA2->coeffs+kk, buf1->coeffs,
     1278                      fq_nmod_poly_length(buf1, fq_con), fq_con);
     1279
     1280    fq_nmod_poly_clear (buf1, fq_con);
     1281  }
     1282  _fq_nmod_poly_normalise (subA1, fq_con);
     1283  _fq_nmod_poly_normalise (subA2, fq_con);
     1284}
     1285#endif
     1286
    12021287void
    12031288kronSubReciproQ (fmpz_poly_t subA1, fmpz_poly_t subA2, const CanonicalForm& A,
     
    14711556}
    14721557
     1558#if (__FLINT_VERSION_MINOR >= 4)
     1559CanonicalForm
     1560reverseSubstReciproFq (const fq_nmod_poly_t F, const fq_nmod_poly_t G, int d,
     1561                       int k, const Variable& alpha, const fq_nmod_ctx_t fq_con)
     1562{
     1563  Variable y= Variable (2);
     1564  Variable x= Variable (1);
     1565
     1566  fq_nmod_poly_t f, g;
     1567  int degf= fq_nmod_poly_degree(F, fq_con);
     1568  int degg= fq_nmod_poly_degree(G, fq_con);
     1569
     1570  fq_nmod_poly_t buf1,buf2, buf3;
     1571
     1572  fq_nmod_poly_init (f, fq_con);
     1573  fq_nmod_poly_init (g, fq_con);
     1574  fq_nmod_poly_set (f, F, fq_con);
     1575  fq_nmod_poly_set (g, G, fq_con);
     1576  if (fq_nmod_poly_length (f, fq_con) < (long) d*(k + 1)) //zero padding
     1577    fq_nmod_poly_fit_length (f, (long) d*(k + 1), fq_con);
     1578
     1579  CanonicalForm result= 0;
     1580  int i= 0;
     1581  int lf= 0;
     1582  int lg= d*k;
     1583  int degfSubLf= degf;
     1584  int deggSubLg= degg-lg;
     1585  int repLengthBuf2, repLengthBuf1, tmp;
     1586  while (degf >= lf || lg >= 0)
     1587  {
     1588    if (degfSubLf >= d)
     1589      repLengthBuf1= d;
     1590    else if (degfSubLf < 0)
     1591      repLengthBuf1= 0;
     1592    else
     1593      repLengthBuf1= degfSubLf + 1;
     1594    fq_nmod_poly_init2 (buf1, repLengthBuf1, fq_con);
     1595    _fq_nmod_poly_set_length (buf1, repLengthBuf1, fq_con);
     1596
     1597    _fq_nmod_vec_set (buf1->coeffs, f->coeffs + lf, repLengthBuf1, fq_con);
     1598    _fq_nmod_poly_normalise (buf1, fq_con);
     1599
     1600    repLengthBuf1= fq_nmod_poly_length (buf1, fq_con);
     1601
     1602    if (deggSubLg >= d - 1)
     1603      repLengthBuf2= d - 1;
     1604    else if (deggSubLg < 0)
     1605      repLengthBuf2= 0;
     1606    else
     1607      repLengthBuf2= deggSubLg + 1;
     1608
     1609    fq_nmod_poly_init2 (buf2, repLengthBuf2, fq_con);
     1610    _fq_nmod_poly_set_length (buf2, repLengthBuf2, fq_con);
     1611    _fq_nmod_vec_set (buf2->coeffs, g->coeffs + lg, repLengthBuf2, fq_con);
     1612
     1613    _fq_nmod_poly_normalise (buf2, fq_con);
     1614    repLengthBuf2= fq_nmod_poly_length (buf2, fq_con);
     1615
     1616    fq_nmod_poly_init2 (buf3, repLengthBuf2 + d, fq_con);
     1617    _fq_nmod_poly_set_length (buf3, repLengthBuf2 + d, fq_con);
     1618    _fq_nmod_vec_set (buf3->coeffs, buf1->coeffs, repLengthBuf1, fq_con);
     1619    _fq_nmod_vec_set (buf3->coeffs + d, buf2->coeffs, repLengthBuf2, fq_con);
     1620
     1621    _fq_nmod_poly_normalise (buf3, fq_con);
     1622
     1623    result += convertFq_nmod_poly_t2FacCF (buf3, x, alpha, fq_con)*power (y, i);
     1624    i++;
     1625
     1626
     1627    lf= i*d;
     1628    degfSubLf= degf - lf;
     1629
     1630    lg= d*(k - i);
     1631    deggSubLg= degg - lg;
     1632
     1633    if (lg >= 0 && deggSubLg > 0)
     1634    {
     1635      if (repLengthBuf2 > degfSubLf + 1)
     1636        degfSubLf= repLengthBuf2 - 1;
     1637      tmp= tmin (repLengthBuf1, deggSubLg + 1);
     1638      _fq_nmod_vec_sub (g->coeffs + lg, g->coeffs + lg, buf1-> coeffs,
     1639                        tmp, fq_con);
     1640    }
     1641    if (lg < 0)
     1642    {
     1643      fq_nmod_poly_clear (buf1, fq_con);
     1644      fq_nmod_poly_clear (buf2, fq_con);
     1645      fq_nmod_poly_clear (buf3, fq_con);
     1646      break;
     1647    }
     1648    if (degfSubLf >= 0)
     1649      _fq_nmod_vec_sub (f->coeffs + lf, f->coeffs + lf, buf2->coeffs,
     1650                        repLengthBuf2, fq_con);
     1651    fq_nmod_poly_clear (buf1, fq_con);
     1652    fq_nmod_poly_clear (buf2, fq_con);
     1653    fq_nmod_poly_clear (buf3, fq_con);
     1654  }
     1655
     1656  fq_nmod_poly_clear (f, fq_con);
     1657  fq_nmod_poly_clear (g, fq_con);
     1658
     1659  return result;
     1660}
     1661#endif
     1662
    14731663CanonicalForm
    14741664reverseSubstReciproQ (const fmpz_poly_t F, const fmpz_poly_t G, int d, int k)
     
    16051795}
    16061796
    1607 CanonicalForm reverseSubstFp (const nmod_poly_t F, int d)
     1797#if (__FLINT_VERSION_MINOR >= 4)
     1798CanonicalForm
     1799reverseSubstFq (const fq_nmod_poly_t F, int d, const Variable& alpha,
     1800                const fq_nmod_ctx_t fq_con)
    16081801{
    16091802  Variable y= Variable (2);
    16101803  Variable x= Variable (1);
    16111804
    1612   nmod_poly_t f;
    1613   mp_limb_t ninv= n_preinvert_limb (getCharacteristic());
    1614   nmod_poly_init_preinv (f, getCharacteristic(), ninv);
    1615   nmod_poly_set (f, F);
    1616 
    1617   nmod_poly_t buf;
     1805  fq_nmod_poly_t buf;
    16181806  CanonicalForm result= 0;
    16191807  int i= 0;
    1620   int degf= nmod_poly_degree(f);
     1808  int degf= fq_nmod_poly_degree(F, fq_con);
    16211809  int k= 0;
    1622   int degfSubK, repLength, j;
     1810  int degfSubK, repLength;
    16231811  while (degf >= k)
    16241812  {
     
    16291817      repLength= degfSubK + 1;
    16301818
     1819    fq_nmod_poly_init2 (buf, repLength, fq_con);
     1820    _fq_nmod_poly_set_length (buf, repLength, fq_con);
     1821    _fq_nmod_vec_set (buf->coeffs, F->coeffs+k, repLength, fq_con);
     1822    _fq_nmod_poly_normalise (buf, fq_con);
     1823
     1824    result += convertFq_nmod_poly_t2FacCF (buf, x, alpha, fq_con)*power (y, i);
     1825    i++;
     1826    k= d*i;
     1827    fq_nmod_poly_clear (buf, fq_con);
     1828  }
     1829
     1830  return result;
     1831}
     1832#endif
     1833
     1834CanonicalForm reverseSubstFp (const nmod_poly_t F, int d)
     1835{
     1836  Variable y= Variable (2);
     1837  Variable x= Variable (1);
     1838
     1839  mp_limb_t ninv= n_preinvert_limb (getCharacteristic());
     1840
     1841  nmod_poly_t buf;
     1842  CanonicalForm result= 0;
     1843  int i= 0;
     1844  int degf= nmod_poly_degree(F);
     1845  int k= 0;
     1846  int degfSubK, repLength, j;
     1847  while (degf >= k)
     1848  {
     1849    degfSubK= degf - k;
     1850    if (degfSubK >= d)
     1851      repLength= d;
     1852    else
     1853      repLength= degfSubK + 1;
     1854
    16311855    nmod_poly_init2_preinv (buf, getCharacteristic(), ninv, repLength);
    16321856    for (j= 0; j < repLength; j++)
    1633       nmod_poly_set_coeff_ui (buf, j, nmod_poly_get_coeff_ui (f, j + k));
     1857      nmod_poly_set_coeff_ui (buf, j, nmod_poly_get_coeff_ui (F, j + k));
    16341858    _nmod_poly_normalise (buf);
    16351859
     
    16391863    nmod_poly_clear (buf);
    16401864  }
    1641   nmod_poly_clear (f);
    16421865
    16431866  return result;
     
    17121935  return A;
    17131936}
     1937
     1938#if (__FLINT_VERSION_MINOR >= 4)
     1939CanonicalForm
     1940mulMod2FLINTFqReci (const CanonicalForm& F, const CanonicalForm& G, const
     1941                    CanonicalForm& M, const Variable& alpha,
     1942                    const fq_nmod_ctx_t fq_con)
     1943{
     1944  int d1= degree (F, 1) + degree (G, 1) + 1;
     1945  d1 /= 2;
     1946  d1 += 1;
     1947
     1948  fq_nmod_poly_t F1, F2;
     1949  kronSubReciproFq (F1, F2, F, d1, fq_con);
     1950
     1951  fq_nmod_poly_t G1, G2;
     1952  kronSubReciproFq (G1, G2, G, d1, fq_con);
     1953
     1954  int k= d1*degree (M);
     1955  fq_nmod_poly_mullow (F1, F1, G1, (long) k, fq_con);
     1956
     1957  int degtailF= degree (tailcoeff (F), 1);;
     1958  int degtailG= degree (tailcoeff (G), 1);
     1959  int taildegF= taildegree (F);
     1960  int taildegG= taildegree (G);
     1961
     1962  int b= fq_nmod_poly_degree (F2, fq_con) + fq_nmod_poly_degree (G2, fq_con) - k
     1963         - degtailF - degtailG + d1*(2+taildegF + taildegG);
     1964
     1965  fq_nmod_poly_reverse (F2, F2, fq_nmod_poly_degree (F2, fq_con), fq_con);
     1966  fq_nmod_poly_reverse (G2, G2, fq_nmod_poly_degree (G2, fq_con), fq_con);
     1967  fq_nmod_poly_mullow (F2, F2, G2, b+1, fq_con);
     1968  fq_nmod_poly_reverse (F2, F2, b, fq_con);
     1969
     1970  int d2= tmax (fq_nmod_poly_degree (F2, fq_con)/d1,
     1971                fq_nmod_poly_degree (F1, fq_con)/d1);
     1972
     1973  CanonicalForm result= reverseSubstReciproFq (F1, F2, d1, d2, alpha, fq_con);
     1974
     1975  fq_nmod_poly_clear (F1, fq_con);
     1976  fq_nmod_poly_clear (F2, fq_con);
     1977  fq_nmod_poly_clear (G1, fq_con);
     1978  fq_nmod_poly_clear (G2, fq_con);
     1979  return result;
     1980}
     1981
     1982CanonicalForm
     1983mulMod2FLINTFq (const CanonicalForm& F, const CanonicalForm& G, const
     1984                CanonicalForm& M, const Variable& alpha,
     1985                const fq_nmod_ctx_t fq_con)
     1986{
     1987  CanonicalForm A= F;
     1988  CanonicalForm B= G;
     1989
     1990  int degAx= degree (A, 1);
     1991  int degAy= degree (A, 2);
     1992  int degBx= degree (B, 1);
     1993  int degBy= degree (B, 2);
     1994  int d1= degAx + 1 + degBx;
     1995  int d2= tmax (degAy, degBy);
     1996
     1997  if (d1 > 128 && d2 > 160 && (degAy == degBy) && (2*degAy > degree (M)))
     1998    return mulMod2FLINTFqReci (A, B, M, alpha, fq_con);
     1999
     2000  fq_nmod_poly_t FLINTA, FLINTB;
     2001  kronSubFq (FLINTA, A, d1, fq_con);
     2002  kronSubFq (FLINTB, B, d1, fq_con);
     2003
     2004  int k= d1*degree (M);
     2005  fq_nmod_poly_mullow (FLINTA, FLINTA, FLINTB, (long) k, fq_con);
     2006
     2007  A= reverseSubstFq (FLINTA, d1, alpha, fq_con);
     2008
     2009  fq_nmod_poly_clear (FLINTA, fq_con);
     2010  fq_nmod_poly_clear (FLINTB, fq_con);
     2011  return A;
     2012}
     2013#endif
    17142014
    17152015CanonicalForm
     
    22522552}
    22532553
    2254 // assumes input to be reduced mod M and to be an element of Fq not Fp
     2554// assumes input to be reduced mod M and to be an element of Fp
    22552555CanonicalForm
    22562556mulMod2NTLFpReci (const CanonicalForm& F, const CanonicalForm& G, const
     
    23612661  if (hasFirstAlgVar (A, alpha) || hasFirstAlgVar (B, alpha))
    23622662  {
     2663#if (HAVE_FLINT && __FLINT_VERSION_MINOR >= 4)
     2664    nmod_poly_t FLINTmipo;
     2665    convertFacCF2nmod_poly_t (FLINTmipo, getMipo (alpha));
     2666
     2667    fq_nmod_ctx_t fq_con;
     2668    fq_nmod_ctx_init_modulus (fq_con, FLINTmipo, "Z");
     2669
     2670    A= mulMod2FLINTFq (A, B, M, alpha, fq_con);
     2671    nmod_poly_clear (FLINTmipo);
     2672    fq_nmod_ctx_clear (fq_con);
     2673#else
    23632674    int degAx= degree (A, 1);
    23642675    int degAy= degree (A, 2);
     
    23882699
    23892700    A= reverseSubstFq (NTLA, d1, alpha);
    2390 
    2391     return A;
     2701#endif
    23922702  }
    23932703  else
     2704  {
    23942705#ifdef HAVE_FLINT
    2395     return mulMod2FLINTFp (A, B, M);
     2706    A= mulMod2FLINTFp (A, B, M);
    23962707#else
    2397     return mulMod2NTLFp (A, B, M);
     2708    A= mulMod2NTLFp (A, B, M);
    23982709#endif
     2710  }
     2711  return A;
    23992712}
    24002713
     
    27613074    else
    27623075    {
     3076      Variable y= Variable (2);
     3077#if (HAVE_FLINT && __FLINT_VERSION_MINOR >= 4)
     3078      nmod_poly_t FLINTmipo;
     3079      fq_nmod_ctx_t fq_con;
     3080
     3081      nmod_poly_init (FLINTmipo, getCharacteristic());
     3082      convertFacCF2nmod_poly_t (FLINTmipo, M);
     3083
     3084      fq_nmod_ctx_init_modulus (fq_con, FLINTmipo, "Z");
     3085
     3086
     3087      fq_nmod_poly_t FLINTA, FLINTB;
     3088      convertFacCF2Fq_nmod_poly_t (FLINTA, swapvar (A, x, y), fq_con);
     3089      convertFacCF2Fq_nmod_poly_t (FLINTB, swapvar (B, x, y), fq_con);
     3090
     3091      fq_nmod_poly_divrem (FLINTA, FLINTB, FLINTA, FLINTB, fq_con);
     3092
     3093      Q= convertFq_nmod_poly_t2FacCF (FLINTA, x, y, fq_con);
     3094
     3095      fq_nmod_poly_clear (FLINTA, fq_con);
     3096      fq_nmod_poly_clear (FLINTB, fq_con);
     3097      nmod_poly_clear (FLINTmipo);
     3098      fq_nmod_ctx_clear (fq_con);
     3099#else
    27633100      bool zz_pEbak= zz_pE::initialized();
    27643101      zz_pEBak bak;
     
    27663103        bak.save();
    27673104      zz_pX mipo= convertFacCF2NTLzzpX (M);
    2768       Variable y= Variable (2);
    27693105      zz_pEX NTLA, NTLB;
    27703106      NTLA= convertFacCF2NTLzz_pEX (swapvar (A, x, y), mipo);
     
    27743110      if (zz_pEbak)
    27753111        bak.restore();
     3112#endif
    27763113    }
    27773114  }
     
    28203157    else
    28213158    {
     3159      Variable y= Variable (2);
     3160#if (HAVE_FLINT && __FLINT_VERSION_MINOR >= 4)
     3161      nmod_poly_t FLINTmipo;
     3162      fq_nmod_ctx_t fq_con;
     3163
     3164      nmod_poly_init (FLINTmipo, getCharacteristic());
     3165      convertFacCF2nmod_poly_t (FLINTmipo, M);
     3166
     3167      fq_nmod_ctx_init_modulus (fq_con, FLINTmipo, "Z");
     3168
     3169      fq_nmod_poly_t FLINTA, FLINTB;
     3170      convertFacCF2Fq_nmod_poly_t (FLINTA, swapvar (A, x, y), fq_con);
     3171      convertFacCF2Fq_nmod_poly_t (FLINTB, swapvar (B, x, y), fq_con);
     3172
     3173      fq_nmod_poly_divrem (FLINTA, FLINTB, FLINTA, FLINTB, fq_con);
     3174
     3175      Q= convertFq_nmod_poly_t2FacCF (FLINTA, x, y, fq_con);
     3176      R= convertFq_nmod_poly_t2FacCF (FLINTB, x, y, fq_con);
     3177
     3178      fq_nmod_poly_clear (FLINTA, fq_con);
     3179      fq_nmod_poly_clear (FLINTB, fq_con);
     3180      nmod_poly_clear (FLINTmipo);
     3181      fq_nmod_ctx_clear (fq_con);
     3182#else
    28223183      zz_pX mipo= convertFacCF2NTLzzpX (M);
    2823       Variable y= Variable (2);
    28243184      zz_pEX NTLA, NTLB;
    28253185      NTLA= convertFacCF2NTLzz_pEX (swapvar (A, x, y), mipo);
     
    28293189      Q= convertNTLzz_pEX2CF (NTLQ, x, y);
    28303190      R= convertNTLzz_pEX2CF (NTLR, x, y);
     3191#endif
    28313192    }
    28323193  }
     
    31503511    if (hasFirstAlgVar (A, alpha) || hasFirstAlgVar (B, alpha))
    31513512    {
     3513#if (HAVE_FLINT && __FLINT_VERSION_MINOR >= 4)
     3514      nmod_poly_t FLINTmipo;
     3515      fq_nmod_ctx_t fq_con;
     3516
     3517      nmod_poly_init (FLINTmipo, getCharacteristic());
     3518      convertFacCF2nmod_poly_t (FLINTmipo, getMipo (alpha));
     3519
     3520      fq_nmod_ctx_init_modulus (fq_con, FLINTmipo, "Z");
     3521
     3522      fq_nmod_poly_t FLINTA, FLINTB;
     3523      convertFacCF2Fq_nmod_poly_t (FLINTA, A, fq_con);
     3524      convertFacCF2Fq_nmod_poly_t (FLINTB, B, fq_con);
     3525      int result= fq_nmod_poly_divides (FLINTA, FLINTB, FLINTA, fq_con);
     3526      fq_nmod_poly_clear (FLINTA, fq_con);
     3527      fq_nmod_poly_clear (FLINTB, fq_con);
     3528      nmod_poly_clear (FLINTmipo);
     3529      fq_nmod_ctx_clear (fq_con);
     3530      return result;
     3531#else
    31523532      zz_pX NTLMipo= convertFacCF2NTLzzpX (getMipo (alpha));
    31533533      zz_pE::init (NTLMipo);
     
    31553535      zz_pEX NTLB= convertFacCF2NTLzz_pEX (B, NTLMipo);
    31563536      return divide (NTLB, NTLA);
     3537#endif
    31573538    }
    31583539#ifdef HAVE_FLINT
Note: See TracChangeset for help on using the changeset viewer.