Changeset 6bbe94 in git


Ignore:
Timestamp:
Oct 17, 2012, 10:28:23 AM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
1bc7201c1a771fb5cc842ca4f475ba3ea91e6979
Parents:
85ea066b03d85152b63440f23f61f3309bf66ef8
git-author:
Martin Lee <martinlee84@web.de>2012-10-17 10:28:23+02:00
git-committer:
Martin Lee <martinlee84@web.de>2012-10-17 17:11:51+02:00
Message:
chg: earlier divisibility testing in tryBrownGCD
chg: no replacing of alg. variable due to changed rational reconstruction
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/algext.cc

    r85ea06 r6bbe94  
    548548        return;
    549549      m *= (x - alpha);
    550       if(gnew == gm) // gnew did not change
    551       {
    552         cf = tryvcontent(gm, Variable(2), M, fail);
     550      if((firstLC(gnew) == gamma) || (gnew == gm)) // gnew did not change
     551      {
     552        cf = tryvcontent(gnew, Variable(2), M, fail);
    553553        if(fail)
    554554          return;
    555555        divides = true;
    556         g_image= gm;
     556        g_image= gnew;
    557557        g_image.tryDiv (cf, M, fail);
    558558        if(fail)
     
    692692  }
    693693  // here: a is the biggest alg. var in f and g AND some of f,g is in extension
    694   // (in the sequel b is used to swap alg/poly vars)
    695694  setReduce(a,false); // do not reduce expressions modulo mipo
    696695  tmp = getMipo(a);
     
    703702    mv = i;
    704703  // here: mv is level of the largest variable in f, g
    705   b = Variable(mv+1);
    706704  bound = new int[mv+1]; // 'bound' could be indexed from 0 to mv, but we will only use from 1 to mv
    707705  other = new int[mv+1];
     
    750748    if(isEqual(bound, other, 1, mv)) // equal
    751749    {
    752       chineseRemainder( D, q, replacevar( mapinto(Dp), a, b ), p, tmp, newq );
     750      chineseRemainder( D, q, mapinto(Dp), p, tmp, newq );
    753751      // tmp = Dp mod p
    754752      // tmp = D mod q
     
    758756        D = tmp;
    759757      On( SW_RATIONAL );
    760       tmp = replacevar( Farey( D, q ), b, a ); // Farey and switch back to alg var
     758      tmp = Farey( D, q ); // Farey
     759      tmp *= bCommonDen (tmp);
    761760      setReduce(a,true); // reduce expressions modulo mipo
    762761      On( SW_RATIONAL ); // needed by fdivides
     
    780779    // here: isLess(other, bound, 1, mv) ) ==> all previous primes unlucky
    781780    q = p;
    782     D = replacevar( mapinto(Dp), a, b ); // shortcut CRA // shortcut CRA
     781    D = mapinto(Dp); // shortcut CRA // shortcut CRA
    783782    for(int i=1; i<=mv; i++) // tighten bound
    784783      bound[i] = other[i];
Note: See TracChangeset for help on using the changeset viewer.