Changeset 15913a6 in git


Ignore:
Timestamp:
Mar 26, 2013, 3:57:35 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'cbf866d4f8c3861325311c042cb2033c053453b2')
Children:
0089393ba2915e65e112c7e3ef5279e5bd56fbe1
Parents:
d4b25e07575f90d19a7fc324664d102ae84e47ad0dff6bc7750e8ac23591245c682dede4e272698b
Message:
Merge pull request #311 from mmklee/factory_opt_sw

chg: threshold for using FLINT factorization over Z/p
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_factor.cc

    rd4b25e r15913a6  
    430430    if (f.isUnivariate())
    431431    {
     432#ifdef HAVE_NTL
    432433#ifdef HAVE_FLINT
    433       nmod_poly_t f1;
    434       convertFacCF2nmod_poly_t (f1, f);
    435       nmod_poly_factor_t result;
    436       nmod_poly_factor_init (result);
    437       mp_limb_t leadingCoeff= nmod_poly_factor (result, f1);
    438       F= convertFLINTnmod_poly_factor2FacCFFList (result, leadingCoeff, f.mvar());
    439       nmod_poly_factor_clear (result);
    440       nmod_poly_clear (f1);
    441 #else
    442 #ifdef HAVE_NTL
     434      if (degree (f) < 300)
     435      {
     436        nmod_poly_t f1;
     437        convertFacCF2nmod_poly_t (f1, f);
     438        nmod_poly_factor_t result;
     439        nmod_poly_factor_init (result);
     440        mp_limb_t leadingCoeff= nmod_poly_factor (result, f1);
     441        F= convertFLINTnmod_poly_factor2FacCFFList (result, leadingCoeff, f.mvar());
     442        nmod_poly_factor_clear (result);
     443        nmod_poly_clear (f1);
     444      }
     445      else
     446#endif
    443447      if (isOn(SW_USE_NTL) && (isPurePoly(f)))
    444448      {
     
    546550          F=FpFactorizeUnivariateCZ( f, issqrfree, 0, Variable(), Variable() );
    547551      }
    548 #endif //HAVE_FLINT
    549552    }
    550553    else
  • factory/facFqBivar.cc

    rd4b25e r15913a6  
    232232  {
    233233#ifdef HAVE_FLINT
    234     nmod_poly_t FLINTA;
    235     convertFacCF2nmod_poly_t (FLINTA, A);
    236     nmod_poly_factor_t result;
    237     nmod_poly_factor_init (result);
    238     mp_limb_t leadingCoeff= nmod_poly_factor (result, FLINTA);
    239     factorsA= convertFLINTnmod_poly_factor2FacCFFList (result, leadingCoeff, x);
    240     if (factorsA.getFirst().factor().inCoeffDomain())
    241       factorsA.removeFirst();
    242     nmod_poly_factor_clear (result);
    243     nmod_poly_clear (FLINTA);
    244 #else
     234    if (degree (A) < 300)
     235    {
     236      nmod_poly_t FLINTA;
     237      convertFacCF2nmod_poly_t (FLINTA, A);
     238      nmod_poly_factor_t result;
     239      nmod_poly_factor_init (result);
     240      mp_limb_t leadingCoeff= nmod_poly_factor (result, FLINTA);
     241      factorsA= convertFLINTnmod_poly_factor2FacCFFList (result, leadingCoeff, x);
     242      if (factorsA.getFirst().factor().inCoeffDomain())
     243        factorsA.removeFirst();
     244      nmod_poly_factor_clear (result);
     245      nmod_poly_clear (FLINTA);
     246    }
     247    else
     248#endif
    245249    if (getCharacteristic() > 2)
    246250    {
     
    260264                                                          x);
    261265    }
    262 #endif
    263266  }
    264267  CFList uniFactors;
Note: See TracChangeset for help on using the changeset viewer.