Changeset 3d6980b in git


Ignore:
Timestamp:
Jun 19, 2020, 4:22:49 PM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
bbec92425869780b8ebb03d87d31a00eabbfec85
Parents:
4c1fc06f2d81e12a8e75a5419444cb157fbe45e9
Message:
opt. factorize
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/NTLconvert.cc

    r4c1fc0 r3d6980b  
    769769  }
    770770  // the multiplicity at pos 1
    771   //if (!IsOne(multi))
    772     result.insert(CFFactor(convertZZ2CF(multi),1));
     771  result.insert(CFFactor(convertZZ2CF(multi),1));
    773772
    774773  //return the converted list
  • factory/cf_factor.cc

    r4c1fc0 r3d6980b  
    478478#ifdef HAVE_NTL
    479479      {
    480         // USE NTL
     480        // use NTL
    481481        if (fac_NTL_char != getCharacteristic())
    482482        {
     
    507507#endif
    508508    }
    509     else
     509    else // char p, multivariate
    510510    {
    511511      #if defined(HAVE_NTL)
     
    563563        fmpz_poly_factor_clear (result);
    564564        fmpz_poly_clear (f1);
    565       }
    566       if ( ! ic.isOne() )
    567       {
    568         if ( F.getFirst().factor().inCoeffDomain() )
     565        if ( ! ic.isOne() )
    569566        {
     567           // according to convertFLINTfmpz_polyfactor2FcaCFFlist,
     568           //  first entry is in CoeffDomain
    570569          CFFactor new_first( F.getFirst().factor() * ic );
    571570          F.removeFirst();
    572571          F.insert( new_first );
    573572        }
    574         else
    575           F.insert( CFFactor( ic ) );
    576573      }
    577574      goto end_char0;
    578575      #elif defined(HAVE_NTL)
    579576      {
    580         //USE NTL
     577        //use NTL
    581578        ZZ c;
    582579        vec_pair_ZZX_long factors;
     
    586583        //convert the result back to Factory
    587584        F=convertNTLvec_pair_ZZX_long2FacCFFList(factors,c,fz.mvar());
    588       }
    589       if ( ! ic.isOne() )
    590       {
    591         if ( F.getFirst().factor().inCoeffDomain() )
     585        if ( ! ic.isOne() )
    592586        {
     587           // according to convertNTLvec_pair_ZZX_long2FacCFFList
     588           //  first entry is in CoeffDomain
    593589          CFFactor new_first( F.getFirst().factor() * ic );
    594590          F.removeFirst();
    595           F.insert( new_first );
    596         }
    597         else
    598           F.insert( CFFactor( ic ) );
    599       }
    600       else
    601       {
    602         if ( !F.getFirst().factor().inCoeffDomain() )
    603         {
    604           CFFactor new_first( 1 );
    605591          F.insert( new_first );
    606592        }
     
    612598      #endif
    613599    }
    614     else // not univariate,  char 0
     600    else // multivariate,  char 0
    615601    {
    616602      On (SW_RATIONAL);
     
    644630    if ( ! cd.isOne() )
    645631    {
    646       if ( F.getFirst().factor().inCoeffDomain() )
    647       {
    648         CFFactor new_first( F.getFirst().factor() / cd );
    649         F.removeFirst();
    650         F.insert( new_first );
    651       }
    652       else
    653       {
    654         F.insert( CFFactor( 1/cd ) );
    655       }
     632      CFFactor new_first( F.getFirst().factor() / cd );
     633      F.removeFirst();
     634      F.insert( new_first );
    656635    }
    657636  }
     
    773752#endif
    774753#if !defined(HAVE_NTL) && !defined(HAVE_FLINT)
    775       factoryError ("univariate factorization  depends on NTL(missing)");
     754      factoryError ("univariate factorization  depends on FLINT/NTL(missing)");
    776755      return CFFList (CFFactor (f, 1));
    777 #endif //HAVE_NTL
    778     }
    779     else
     756#endif
     757    }
     758    else // char p, multivariate
    780759    {
    781760      #ifdef HAVE_NTL
Note: See TracChangeset for help on using the changeset viewer.