Changeset 2488dc3 in git


Ignore:
Timestamp:
May 11, 2012, 5:46:42 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ea5ff1d5094b84bbc2e29abd61b17ca3343f5c23
Parents:
72bfc80277ea4841efcc1006285e513061f17917
git-author:
Martin Lee <martinlee84@web.de>2012-05-11 17:46:42+02:00
git-committer:
Martin Lee <martinlee84@web.de>2012-07-31 11:31:14+02:00
Message:
chg: use other GCD if input is not dense in chinrem_gcd
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_gcd.cc

    r72bfc8 r2488dc3  
    12331233  cl =  gcd (f.lc(),g.lc());
    12341234  CanonicalForm gcdcfcg= gcd (cf, cg);
     1235  CanonicalForm fp, gp;
    12351236  CanonicalForm b= 1;
    12361237  int minCommonDeg= 0;
     
    12601261
    12611262  CanonicalForm cof, cog, cofp, cogp, newCof, newCog, cofn, cogn;
     1263  int maxNumVars= tmax (getNumVars (f), getNumVars (g));
    12621264  //Off (SW_RATIONAL);
    12631265  while ( true )
     
    12721274    //printf("try p=%d\n",p);
    12731275    setCharacteristic( p );
     1276    fp= mapinto (f);
     1277    gp= mapinto (g);
    12741278#ifdef HAVE_NTL
    1275     Dp = GCD_small_p (mapinto (f), mapinto (g), cofp, cogp);
     1279    if (size (fp)/maxNumVars > 500 && size (gp)/maxNumVars > 500)
     1280      Dp = GCD_small_p (fp, gp, cofp, cogp);
     1281    else
     1282    {
     1283      Dp= gcd_poly (fp, gp);
     1284      cofp= fp/Dp;
     1285      cogp= gp/Dp;
     1286    }
    12761287#else
    1277     Dp= gcd_poly (mapinto (f), mapinto (g));
    1278     cofp= mapinto (f)/Dp;
    1279     cogp= mapinto (g)/Dp;
     1288    Dp= gcd_poly (fp, gp);
     1289    cofp= fp/Dp;
     1290    cogp= gp/Dp;
    12801291#endif
    12811292    Dp /=Dp.lc();
Note: See TracChangeset for help on using the changeset viewer.