Changeset b1d287 in git for factory/cf_gcd.cc


Ignore:
Timestamp:
Aug 1, 2012, 2:25:24 AM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'c987db42cd2ec943b97ac5746c99892ceddf909c')
Children:
0df59c8a8e59eded04e4aca4e57cfed188a00cf1
Parents:
09afeb85ea17e564813761786f76281c8162dad0362fc6799a207ad61d3be8abe0206e52b5782e50
Message:
Merge pull request #157 from mmklee/factory_catch_up_sw

Factory catch up sw
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_gcd.cc

    r09afeb rb1d287  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id$ */
    32
    43#include "config.h"
     
    12331232  cl =  gcd (f.lc(),g.lc());
    12341233  CanonicalForm gcdcfcg= gcd (cf, cg);
     1234  CanonicalForm fp, gp;
    12351235  CanonicalForm b= 1;
    12361236  int minCommonDeg= 0;
     
    12601260
    12611261  CanonicalForm cof, cog, cofp, cogp, newCof, newCog, cofn, cogn;
     1262  int maxNumVars= tmax (getNumVars (f), getNumVars (g));
    12621263  //Off (SW_RATIONAL);
    12631264  while ( true )
     
    12721273    //printf("try p=%d\n",p);
    12731274    setCharacteristic( p );
     1275    fp= mapinto (f);
     1276    gp= mapinto (g);
    12741277#ifdef HAVE_NTL
    1275     Dp = GCD_small_p (mapinto (f), mapinto (g), cofp, cogp);
     1278    if (size (fp)/maxNumVars > 500 && size (gp)/maxNumVars > 500)
     1279      Dp = GCD_small_p (fp, gp, cofp, cogp);
     1280    else
     1281    {
     1282      Dp= gcd_poly (fp, gp);
     1283      cofp= fp/Dp;
     1284      cogp= gp/Dp;
     1285    }
    12761286#else
    1277     Dp= gcd_poly (mapinto (f), mapinto (g));
    1278     cofp= mapinto (f)/Dp;
    1279     cogp= mapinto (g)/Dp;
     1287    Dp= gcd_poly (fp, gp);
     1288    cofp= fp/Dp;
     1289    cogp= gp/Dp;
    12801290#endif
    12811291    Dp /=Dp.lc();
Note: See TracChangeset for help on using the changeset viewer.