Changeset 03c742 in git for factory/cf_irred.cc


Ignore:
Timestamp:
Jun 26, 2020, 6:03:59 PM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
f87a54f01779194a0163ca39873f5b4255a4f510
Parents:
b666c768103c724ed3617954c684de0e621144d2
Message:
factory: BuildIrred, FLINT/NTL seperation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_irred.cc

    rb666c7 r03c742  
    1414#ifdef HAVE_NTL
    1515#include "NTLconvert.h"
     16#endif
     17
     18#ifdef HAVE_FLINT
     19#include "FLINTconvert.h"
    1620#endif
    1721
     
    3640}
    3741
    38 #ifdef HAVE_NTL
     42#if defined(HAVE_NTL) || defined(HAVE_FLINT)
    3943/// computes a random monic irreducible univariate polynomial in x over Fp of
    40 /// degree i via NTL
     44/// degree i via NTL/FLINT
    4145CanonicalForm
    4246randomIrredpoly (int i, const Variable & x)
    4347{
    4448  int p= getCharacteristic();
     49  #ifdef HAVE_FLINT
     50  nmod_poly_t Irredpoly;
     51  nmod_poly_init(Irredpoly,p);
     52  nmod_poly_randtest_monic_irreducible(Irredpoly, FLINTrandom, i+1);
     53  CanonicalForm CFirredpoly=convertnmod_poly_t2FacCF(Irredpoly,Variable(1));
     54  nmod_poly_clear(Irredpoly);
     55  #elif defined(HAVE_NTL)
    4556  if (fac_NTL_char != p)
    4657  {
     
    4960  }
    5061  zz_pX NTLirredpoly;
    51   CanonicalForm CFirredpoly;
    5262  BuildIrred (NTLirredpoly, i);
    53   CFirredpoly= convertNTLzzpX2CF (NTLirredpoly, x);
     63  CanonicalForm CFirredpoly= convertNTLzzpX2CF (NTLirredpoly, x);
     64  #endif
    5465  return CFirredpoly;
    5566}
Note: See TracChangeset for help on using the changeset viewer.