Changeset b8f8ea in git for factory/cf_gcd_smallp.cc


Ignore:
Timestamp:
Apr 9, 2013, 3:24:54 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
84299e1e1d2b92c5e28fc52391cc529f8eb8ade7f8565ac2b56eae4e46fb63670efa1bc402ae3628
Parents:
8e48d4973dda2a880260a9e9a6e0705b49ab77960b447e5e0cc1cede9cfd6c91fab1752432a2bd62
Message:
Merge pull request #314 from mmklee/factory_bugfix_sw

Factory bugfix sw
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_gcd_smallp.cc

    r8e48d49 rb8f8ea  
    383383  int p= getCharacteristic ();
    384384  int d= degree (mipo);
    385   int bound= ipower (p, d);
     385  double bound= pow ((double) p, (double) d);
    386386  do
    387387  {
     
    436436  CanonicalForm newMipo= convertNTLzzpX2CF (NTLIrredpoly, Variable (1));
    437437  return rootOf (newMipo);
    438 }
    439 
    440 /// chooses a suitable extension of \f$ F_{p}(\alpha ) \f$
    441 /// we do not extend \f$ F_{p}(\alpha ) \f$ itself but extend \f$ F_{p} \f$ ,
    442 /// s.t. \f$ F_{p}(\alpha ) \subset F_{p}(\beta ) \f$
    443 static inline
    444 void choose_extension (const int& d, const int& num_vars, Variable& beta)
    445 {
    446   int p= getCharacteristic();
    447   if (p != fac_NTL_char)
    448   {
    449     fac_NTL_char= p;
    450     zz_p::init (p);
    451   }
    452   zz_pX NTLirredpoly;
    453   //TODO: replace d by max_{i} (deg_x{i}(f))
    454   int i= (int) (log ((double) ipower (d + 1, num_vars))/log ((double) p));
    455   int m= degree (getMipo (beta));
    456   if (i <= 1)
    457     i= 2;
    458   BuildIrred (NTLirredpoly, i*m);
    459   CanonicalForm mipo= convertNTLzzpX2CF (NTLirredpoly, Variable(1));
    460   beta= rootOf (mipo);
    461438}
    462439
     
    22532230  GFRandom genGF;
    22542231  int p= getCharacteristic ();
    2255   int bound;
     2232  double bound;
    22562233  if (alpha != Variable (1))
    22572234  {
    2258     bound= ipower (p, degree (getMipo(alpha)));
    2259     bound= ipower (bound, k);
     2235    bound= pow ((double) p, (double) degree (getMipo(alpha)));
     2236    bound= pow (bound, (double) k);
    22602237  }
    22612238  else if (GF)
    22622239  {
    2263     bound= ipower (p, getGFDegree());
    2264     bound= ipower (bound, k);
     2240    bound= pow ((double) p, (double) getGFDegree());
     2241    bound= pow ((double) bound, (double) k);
    22652242  }
    22662243  else
    2267     bound= ipower (p, k);
     2244    bound= pow ((double) p, (double) k);
    22682245
    22692246  CanonicalForm random;
Note: See TracChangeset for help on using the changeset viewer.