Changeset 1e4b53 in git


Ignore:
Timestamp:
May 3, 2012, 3:53:02 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
60cc1289a79586c1732ba3885997c3cb49bc01d9
Parents:
0d56271c672440c06e14ca2528a5185bb37e1e6f
git-author:
Martin Lee <martinlee84@web.de>2012-05-03 15:53:02+02:00
git-committer:
Martin Lee <martinlee84@web.de>2012-05-07 14:18:40+02:00
Message:
chg: first test LC's before doing a full termination test in GCD
Location:
factory
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_gcd.cc

    r0d5627 r1e4b53  
    13451345        equal= true;
    13461346      //Dn /=vcontent(Dn,Variable(1));
    1347       if (((abs (cofn*Dn)==abs (f)) && (abs (cogn*Dn)==abs (g))) ||
     1347      if ((terminationTest (f,g, cofn, cogn, Dn)) ||
    13481348          ((equal || q > b) && fdivides (Dn, f) && fdivides (Dn, g)))
    13491349      {
  • factory/cf_gcd_smallp.cc

    r0d5627 r1e4b53  
    5151TIMING_DEFINE_PRINT(newton_interpolation)
    5252
     53bool
     54terminationTest (const CanonicalForm& F, const CanonicalForm& G,
     55                 const CanonicalForm& coF, const CanonicalForm& coG,
     56                 const CanonicalForm& cand)
     57{
     58  CanonicalForm LCCand= abs (LC (cand));
     59  if (LCCand*abs (LC (coF)) == abs (LC (F)))
     60  {
     61    if (LCCand*abs (LC (coG)) == abs (LC (G)))
     62    {
     63      if (abs (cand)*abs (coF) == abs (F))
     64      {
     65        if (abs (cand)*abs (coG) == abs (G))
     66          return true;
     67      }
     68      return false;
     69    }
     70    return false;
     71  }
     72  return false;
     73}
     74
    5375static const double log2exp= 1.442695041;
    5476
     
    805827        if (((degree (ppCoF,1)+degree (ppH,1) == bound1) &&
    806828             (degree (ppCoG,1)+degree (ppH,1) == bound2) &&
    807              (ppA == ppCoF*ppH && ppB == ppCoG*ppH)) ||
     829             terminationTest (ppA, ppB, ppCoF, ppCoG, ppH)) ||
    808830             (fdivides (ppH, ppA, ppCoF) && fdivides (ppH, ppB, ppCoG)))
    809831        {
     
    828850      else if (((degree (ppCoF,1)+degree (ppH,1) == bound1) &&
    829851                (degree (ppCoG,1)+degree (ppH,1) == bound2) &&
    830                 (ppA == ppCoF*ppH && ppB == ppCoG*ppH)) ||
     852                terminationTest (ppA, ppB, ppCoF, ppCoG, ppH)) ||
    831853                (fdivides (ppH, ppA, ppCoF) && fdivides (ppH, ppB, ppCoG)))
    832854      {
     
    12551277        if (((degree (ppCoF,1)+degree (ppH,1) == bound1) &&
    12561278             (degree (ppCoG,1)+degree (ppH,1) == bound2) &&
    1257              (ppA == ppCoF*ppH && ppB == ppCoG*ppH)) ||
     1279             terminationTest (ppA, ppB, ppCoF, ppCoG, ppH)) ||
    12581280             (fdivides (ppH, ppA, ppCoF) && fdivides (ppH, ppB, ppCoG)))
    12591281        {
     
    12791301      if (((degree (ppCoF,1)+degree (ppH,1) == bound1) &&
    12801302           (degree (ppCoG,1)+degree (ppH,1) == bound2) &&
    1281            (ppA == ppCoF*ppH && ppB == ppCoG*ppH)) ||
     1303           terminationTest (ppA, ppB, ppCoF, ppCoG, ppH)) ||
    12821304           (fdivides (ppH, ppA, ppCoF) && fdivides (ppH, ppB, ppCoG)))
    12831305        {
     
    17731795      if (((degree (ppCoF,1)+degree (ppH,1) == bound1) &&
    17741796           (degree (ppCoG,1)+degree (ppH,1) == bound2) &&
    1775            (ppA == ppCoF*ppH && ppB == ppCoG*ppH)) ||
     1797           terminationTest (ppA, ppB, ppCoF, ppCoG, ppH)) ||
    17761798           (fdivides (ppH, ppA, ppCoF) && fdivides (ppH, ppB, ppCoG)))
    17771799      {
  • factory/cf_gcd_smallp.h

    r0d5627 r1e4b53  
    112112CFArray
    113113getMonoms (const CanonicalForm& F);
     114
     115bool
     116terminationTest (const CanonicalForm& F, const CanonicalForm& G,
     117                 const CanonicalForm& coF, const CanonicalForm& coG,
     118                 const CanonicalForm& cand);
    114119#endif
Note: See TracChangeset for help on using the changeset viewer.