Changeset 9084a3 in git


Ignore:
Timestamp:
Jun 26, 2020, 11:45:10 PM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
Children:
b7cc2b30ec0e493f5f022b5a29a071d4b7ce31a7
Parents:
f87a54f01779194a0163ca39873f5b4255a4f510
Message:
fix: univariate factorization over Z/p(alpha) via NTL
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/NTLconvert.cc

    rf87a54f r9084a3  
    130130    {  //This case will never happen if the characteristic is in fact a prime
    131131       // number, since all coefficients are represented as immediates
     132       out_cf("f:->",f,"\n");
     133       out_cf("c:->",c,"\n");
    132134       #ifndef NOSTREAMIO
    133135       cout<<"convertFacCF2NTLzz_pX: coefficient not immediate! : "<<f<<"\n";
  • factory/cf_factor.cc

    rf87a54f r9084a3  
    565565        if ( ! ic.isOne() )
    566566        {
    567            // according to convertFLINTfmpz_polyfactor2FcaCFFlist,
    568            //  first entry is in CoeffDomain
     567           // according to convertFLINTfmpz_polyfactor2FcaCFFlist,
     568           //  first entry is in CoeffDomain
    569569          CFFactor new_first( F.getFirst().factor() * ic );
    570570          F.removeFirst();
     
    585585        if ( ! ic.isOne() )
    586586        {
    587            // according to convertNTLvec_pair_ZZX_long2FacCFFList
    588            //  first entry is in CoeffDomain
     587           // according to convertNTLvec_pair_ZZX_long2FacCFFList
     588           //  first entry is in CoeffDomain
    589589          CFFactor new_first( F.getFirst().factor() * ic );
    590590          F.removeFirst();
     
    735735        }
    736736
     737        // set minimal polynomial in NTL
     738        zz_pX minPo=convertFacCF2NTLzzpX(getMipo(alpha));
     739        zz_pE::init (minPo);
     740
    737741        // convert to NTL
    738         zz_pX f1=convertFacCF2NTLzzpX(f);
    739         zz_p leadcoeff = LeadCoeff(f1);
     742        zz_pEX f1=convertFacCF2NTLzz_pEX(f,minPo);
     743        zz_pE leadcoeff= LeadCoeff(f1);
    740744
    741745        //make monic
    742746        f1=f1 / LeadCoeff(f1);
     747
    743748        // factorize
    744         vec_pair_zz_pX_long factors;
     749        vec_pair_zz_pEX_long factors;
    745750        CanZass(factors,f1);
    746751
    747         F=convertNTLvec_pair_zzpX_long2FacCFFList(factors,leadcoeff,f.mvar());
     752        // return converted result
     753        F=convertNTLvec_pair_zzpEX_long2FacCFFList(factors,leadcoeff,f.mvar(),alpha);
    748754        //test_cff(F,f);
    749755        if(isOn(SW_USE_NTL_SORT)) F.sort(cmpCF);
Note: See TracChangeset for help on using the changeset viewer.