Changeset 1e4b53 in git for factory/cf_gcd_smallp.cc


Ignore:
Timestamp:
May 3, 2012, 3:53:02 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'ec94ef7a30b928574c0c3daf41f6804dff5f6b69')
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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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      {
Note: See TracChangeset for help on using the changeset viewer.