Changeset 142afd in git


Ignore:
Timestamp:
Sep 11, 2013, 3:30:00 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
Children:
1e5bbd70c45325682c85dd82ac76bdd5d0cdecbf
Parents:
d83c0bc579fb38d2539c9c3b55cba1c04ccf3ff2
git-author:
Martin Lee <martinlee84@web.de>2013-09-11 15:30:00+02:00
git-committer:
Martin Lee <martinlee84@web.de>2013-09-11 15:31:05+02:00
Message:
deleted more unnecessary stuff using NTL in non-word size case in univariate factorization
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_factor.cc

    rd83c0b r142afd  
    455455          {
    456456            fac_NTL_char = getCharacteristic();
    457             #ifndef NTL_ZZ
    458             if (fac_NTL_char > NTL_SP_BOUND)
    459             {
    460               ZZ r;
    461               r=getCharacteristic();
    462               ZZ_pContext ccc(r);
    463               ccc.restore();
    464               ZZ_p::init(r);
    465             }
    466             else
    467             #endif
    468             {
    469               #ifdef NTL_ZZ
    470               ZZ r;
    471               r=getCharacteristic();
    472               ZZ_pContext ccc(r);
    473               #else
    474               zz_pContext ccc(getCharacteristic());
    475               #endif
    476               ccc.restore();
    477               #ifdef NTL_ZZ
    478               ZZ_p::init(r);
    479               #else
    480               zz_p::init(getCharacteristic());
    481               #endif
    482             }
     457            zz_p::init(getCharacteristic());
    483458          }
    484           #ifndef NTL_ZZ
    485           if (fac_NTL_char > NTL_SP_BOUND)
    486           {
    487             // convert to NTL
    488             ZZ_pX f1=convertFacCF2NTLZZpX(f);
    489             ZZ_p leadcoeff = LeadCoeff(f1);
    490             //make monic
    491             f1=f1 / LeadCoeff(f1);
    492             // factorize
    493             vec_pair_ZZ_pX_long factors;
    494             CanZass(factors,f1);
    495             // convert back to factory
    496             F=convertNTLvec_pair_ZZpX_long2FacCFFList(factors,leadcoeff,f.mvar());
    497           }
    498           else
    499           #endif
    500           {
    501             // convert to NTL
    502             #ifdef NTL_ZZ
    503             ZZ_pX f1=convertFacCF2NTLZZpX(f);
    504             ZZ_p leadcoeff = LeadCoeff(f1);
    505             #else
    506             zz_pX f1=convertFacCF2NTLzzpX(f);
    507             zz_p leadcoeff = LeadCoeff(f1);
    508             #endif
    509             //make monic
    510             f1=f1 / LeadCoeff(f1);
    511             // factorize
    512             #ifdef NTL_ZZ
    513             vec_pair_ZZ_pX_long factors;
    514             #else
    515             vec_pair_zz_pX_long factors;
    516             #endif
    517             CanZass(factors,f1);
    518             // convert back to factory
    519             #ifdef NTL_ZZ
    520             F=convertNTLvec_pair_ZZpX_long2FacCFFList(factors,leadcoeff,f.mvar());
    521             #else
    522             F=convertNTLvec_pair_zzpX_long2FacCFFList(factors,leadcoeff,f.mvar());
    523             #endif
    524           }
     459
     460          // convert to NTL
     461          zz_pX f1=convertFacCF2NTLzzpX(f);
     462          zz_p leadcoeff = LeadCoeff(f1);
     463
     464          //make monic
     465          f1=f1 / LeadCoeff(f1);
     466          // factorize
     467          vec_pair_zz_pX_long factors;
     468          CanZass(factors,f1);
     469
     470          F=convertNTLvec_pair_zzpX_long2FacCFFList(factors,leadcoeff,f.mvar());
    525471          //test_cff(F,f);
    526472        }
     
    716662        {
    717663          fac_NTL_char = getCharacteristic();
    718           #ifdef NTL_ZZ
    719           ZZ r;
    720           r=getCharacteristic();
    721           ZZ_pContext ccc(r);
    722           #else
    723           zz_pContext ccc(getCharacteristic());
    724           #endif
    725           ccc.restore();
    726           #ifdef NTL_ZZ
    727           ZZ_p::init(r);
    728           #else
    729664          zz_p::init(getCharacteristic());
    730           #endif
    731665        }
    732666
    733667        // set minimal polynomial in NTL
    734         #ifdef NTL_ZZ
    735         ZZ_pX minPo=convertFacCF2NTLZZpX(getMipo(alpha));
    736         ZZ_pEContext c(minPo);
    737         #else
    738668        zz_pX minPo=convertFacCF2NTLzzpX(getMipo(alpha));
    739         zz_pEContext c(minPo);
    740         #endif
    741 
    742         c.restore();
     669        zz_pE::init (minPo);
    743670
    744671        // convert to NTL
    745         #ifdef NTL_ZZ
    746         ZZ_pEX f1=convertFacCF2NTLZZ_pEX(f,minPo);
    747         ZZ_pE leadcoeff= LeadCoeff(f1);
    748         #else
    749672        zz_pEX f1=convertFacCF2NTLzz_pEX(f,minPo);
    750673        zz_pE leadcoeff= LeadCoeff(f1);
    751         #endif
    752674
    753675        //make monic
     
    755677
    756678        // factorize using NTL
    757         #ifdef NTL_ZZ
    758         vec_pair_ZZ_pEX_long factors;
    759         #else
    760679        vec_pair_zz_pEX_long factors;
    761         #endif
    762680        CanZass(factors,f1);
    763681
    764682        // return converted result
    765         #ifdef NTL_ZZ
    766         F=convertNTLvec_pair_ZZpEX_long2FacCFFList(factors,leadcoeff,f.mvar(),alpha);
    767         #else
    768683        F=convertNTLvec_pair_zzpEX_long2FacCFFList(factors,leadcoeff,f.mvar(),alpha);
    769         #endif
    770684      }
    771685      else if (/*getCharacteristic()*/ch==2)
     
    774688
    775689        // remainder is two ==> nothing to do
    776         // set remainder
    777         ZZ r;
    778         r=getCharacteristic();
    779         ZZ_pContext ccc(r);
    780         ccc.restore();
    781690
    782691        // set minimal polynomial in NTL using the optimized conversion routines for characteristic 2
    783692        GF2X minPo=convertFacCF2NTLGF2X(getMipo(alpha,f.mvar()));
    784         GF2EContext c(minPo);
    785         c.restore();
     693        GF2E::init (minPo);
    786694
    787695        // convert to NTL again using the faster conversion routines
Note: See TracChangeset for help on using the changeset viewer.