Changeset e4e36c in git


Ignore:
Timestamp:
Apr 30, 2013, 3:46:37 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '5a0dde71de01068fad5736a17555c993ecbbf495')
Children:
08a955b3ca689a48afd7f7c5849c4179954a1ddb
Parents:
cd4d87371ccfef4e30358d86d7d9b9c7d69ed4aa
git-author:
Martin Lee <martinlee84@web.de>2013-04-30 15:46:37+02:00
git-committer:
Martin Lee <martinlee84@web.de>2013-05-02 11:42:45+02:00
Message:
chg: in case there is no FLINT use NTL
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/facAbsFact.cc

    rcd4d87 re4e36c  
    2929#endif
    3030
    31 #ifdef HAVE_FLINT
    3231#ifdef HAVE_NTL
    3332
     
    238237    //TODO take floor (log2(k))
    239238    k= k+1;
     239#ifdef HAVE_FLINT
    240240    fmpz_poly_t FLINTFi;
    241241    convertFacCF2Fmpz_poly_t (FLINTFi, Fi);
     
    277277
    278278    setCharacteristic(0);
    279     modpk pk= modpk (p,k);
    280279    CanonicalForm liftedSmallestFactor=
    281280    convertFmpz_poly_t2FacCF ((fmpz_poly_t &)liftedFactors->p[0],Variable (1));
     
    283282    CanonicalForm otherFactor=
    284283    convertFmpz_poly_t2FacCF ((fmpz_poly_t &)liftedFactors->p[1],Variable (1));
    285     CanonicalForm test= pk (otherFactor*liftedSmallestFactor);
     284    modpk pk= modpk (p, k);
     285#else
     286    modpk pk= modpk (p, k);
     287    ZZX NTLFi=convertFacCF2NTLZZX (pk (Fi*pk.inverse (lc(Fi))));
     288    setCharacteristic (p);
     289
     290    if (fac_NTL_char != p)
     291    {
     292      fac_NTL_char= p;
     293      zz_p::init (p);
     294    }
     295    zz_pX NTLFpi, NTLGpi;
     296    if (i == 2)
     297    {
     298      NTLFpi= convertFacCF2NTLzzpX (smallestFactorEvalx/lc (smallestFactorEvalx));
     299      NTLGpi= convertFacCF2NTLzzpX (Gpx/lc (Gpx));
     300    }
     301    else
     302    {
     303      NTLFpi= convertFacCF2NTLzzpX (smallestFactorEvaly/lc (smallestFactorEvaly));
     304      NTLGpi= convertFacCF2NTLzzpX (Gpy/lc (Gpy));
     305    }
     306    vec_zz_pX modFactors;
     307    modFactors.SetLength(2);
     308    modFactors[0]= NTLFpi;
     309    modFactors[1]= NTLGpi;
     310    vec_ZZX liftedFactors;
     311    MultiLift (liftedFactors, modFactors, NTLFi, (long) k);
     312    setCharacteristic(0);
     313    CanonicalForm liftedSmallestFactor=
     314                  convertNTLZZX2CF (liftedFactors[0],Variable (1));
     315
     316    CanonicalForm otherFactor=
     317                  convertNTLZZX2CF (liftedFactors[1], Variable (1));
     318#endif
    286319
    287320    Off (SW_SYMMETRIC_FF);
     
    317350    mipoFactors.removeFirst();
    318351
     352#ifdef HAVE_FLINT
    319353    fmpz_poly_clear (v[0]);
    320354    fmpz_poly_clear (v[1]);
     
    325359    delete [] link;
    326360    fmpz_poly_factor_clear (liftedFactors);
     361#endif
    327362
    328363    if (mipoFactors.length() > 1 ||
     
    537572
    538573#endif
    539 #endif
    540 
    541 
     574
     575
  • factory/facAbsFact.h

    rcd4d87 re4e36c  
    8787/*BEGINPUBLIC*/
    8888
     89#ifdef HAVE_NTL
    8990CFAFList absFactorize (const CanonicalForm& G);
     91#endif
    9092
    9193/*ENDPUBLIC*/
Note: See TracChangeset for help on using the changeset viewer.