Changeset 249d81 in git


Ignore:
Timestamp:
Jul 7, 2020, 12:52:39 PM (3 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
914b60371b89ca64f4de49c2623ae8ed3cbe48b9d0adb23686023dffa37da6380408f9f10d314ae4
Parents:
2570f085de2f12e59dac4ee40e02b9172adb8559
Message:
factory: suppoirt FLINT 2.5.2
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/FLINTconvert.cc

    r2570f08 r249d81  
    384384  bool save_sym_ff= isOn (SW_SYMMETRIC_FF);
    385385  if (save_sym_ff) Off (SW_SYMMETRIC_FF);
     386  #if __FLINT_RELEASE >= 20503
    386387  nmod_poly_t res;
    387388  nmod_poly_init(res,getCharacteristic());
     389  #endif
    388390  for (CFIterator i= f; i.hasTerms(); i++)
    389391  {
     
    399401    {
    400402      STICKYASSERT (i.exp() <= fq_nmod_ctx_degree(ctx), "convertFacCF2Fq_nmod_t: element is not reduced");
     403      #if __FLINT_RELEASE >= 20503
    401404      nmod_poly_set_coeff_ui (res, i.exp(), c.intval());
    402     }
    403   }
     405      #else
     406      nmod_poly_set_coeff_ui (result, i.exp(), c.intval());
     407      #endif
     408    }
     409  }
     410  #if __FLINT_RELEASE >= 20503
    404411  fq_nmod_init(result,ctx);
    405412  fq_nmod_set_nmod_poly(result,res,ctx);
     413  #endif
    406414  if (save_sym_ff) On (SW_SYMMETRIC_FF);
    407415}
  • factory/cf_map_ext.cc

    r2570f08 r249d81  
    352352  int d= degree (mipo);
    353353  int p= getCharacteristic ();
    354   #ifdef HAVE_FLINT
     354  #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503)
    355355  nmod_poly_t FLINT_mipo;
    356356  nmod_poly_init(FLINT_mipo,p);
     
    369369  do
    370370  {
    371     #ifdef HAVE_FLINT
     371    #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503)
    372372    nmod_poly_randtest_monic_irreducible(FLINT_mipo, FLINTrandom, d+1);
    373373    mipo2=convertnmod_poly_t2FacCF(FLINT_mipo,Variable(1));
     
    386386      return 0;
    387387  } while (1);
    388   #ifdef HAVE_FLINT
     388  #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503)
    389389  nmod_poly_clear(FLINT_mipo);
    390390  // convert alpha_mipo
     
    451451    CanonicalForm primElemMipo= findMinPoly (primElem, alpha);
    452452    int p= getCharacteristic ();
    453     #ifdef HAVE_FLINT
     453    #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503)
    454454    // convert mipo1
    455455    nmod_poly_t mipo1;
     
    505505  }
    506506  int p= getCharacteristic ();
    507   #ifdef HAVE_FLINT
     507  #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503)
    508508  // convert mipo
    509509  nmod_poly_t mipo1;
     
    576576}
    577577
    578 #ifdef HAVE_FLINT
     578#if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503)
    579579/*
    580580    g is in Fp[x]
     
    631631  ASSERT (F.isUnivariate() && F.mvar()==alpha,"expected element of F_p(alpha)");
    632632
    633   #if defined(HAVE_NTL) && !defined(HAVE_FLINT)
    634   if (fac_NTL_char != getCharacteristic())
    635   {
    636     fac_NTL_char= getCharacteristic();
    637     zz_p::init (getCharacteristic());
    638   }
    639   zz_pX NTLF= convertFacCF2NTLzzpX (F);
    640   int d= degree (getMipo (alpha));
    641 
    642   zz_pX NTLMipo= convertFacCF2NTLzzpX (getMipo(alpha));
    643   zz_pE::init (NTLMipo);
    644   vec_zz_p pows;
    645   pows.SetLength (2*d);
    646 
    647   zz_pE powNTLF;
    648   set (powNTLF);
    649   zz_pE NTLFE= to_zz_pE (NTLF);
    650   zz_pX buf;
    651   for (int i= 0; i < 2*d; i++)
    652   {
    653     buf= rep (powNTLF);
    654     buf.rep.SetLength (d);
    655     pows [i]= buf.rep[0];
    656     powNTLF *= NTLFE;
    657   }
    658 
    659   zz_pX NTLMinPoly;
    660   MinPolySeq (NTLMinPoly, pows, d);
    661 
    662   return convertNTLzzpX2CF (NTLMinPoly, Variable (1));
    663   #elif defined(HAVE_FLINT)
     633  #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503)
    664634  nmod_poly_t FLINT_F,FLINT_alpha,g;
    665635  nmod_poly_init(g,getCharacteristic());
     
    672642  nmod_poly_clear(g);
    673643  return res;
     644  #elif defined(HAVE_NTL)
     645  if (fac_NTL_char != getCharacteristic())
     646  {
     647    fac_NTL_char= getCharacteristic();
     648    zz_p::init (getCharacteristic());
     649  }
     650  zz_pX NTLF= convertFacCF2NTLzzpX (F);
     651  int d= degree (getMipo (alpha));
     652
     653  zz_pX NTLMipo= convertFacCF2NTLzzpX (getMipo(alpha));
     654  zz_pE::init (NTLMipo);
     655  vec_zz_p pows;
     656  pows.SetLength (2*d);
     657
     658  zz_pE powNTLF;
     659  set (powNTLF);
     660  zz_pE NTLFE= to_zz_pE (NTLF);
     661  zz_pX buf;
     662  for (int i= 0; i < 2*d; i++)
     663  {
     664    buf= rep (powNTLF);
     665    buf.rep.SetLength (d);
     666    pows [i]= buf.rep[0];
     667    powNTLF *= NTLFE;
     668  }
     669
     670  zz_pX NTLMinPoly;
     671  MinPolySeq (NTLMinPoly, pows, d);
     672
     673  return convertNTLzzpX2CF (NTLMinPoly, Variable (1));
    674674  #endif
    675675}
Note: See TracChangeset for help on using the changeset viewer.