Changeset 9084a3 in git for factory/cf_factor.cc


Ignore:
Timestamp:
Jun 26, 2020, 11:45:10 PM (3 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
b7cc2b30ec0e493f5f022b5a29a071d4b7ce31a7
Parents:
f87a54f01779194a0163ca39873f5b4255a4f510
Message:
fix: univariate factorization over Z/p(alpha) via NTL
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.