Changeset 58316de in git for kernel/GBEngine/kutil.cc


Ignore:
Timestamp:
Nov 24, 2018, 4:44:53 PM (5 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
081f8d89bef1a35313405d0ccb8d5b71ff52516f
Parents:
b95a5fd690d6e706af819dfdf1070a990219bf41
Message:
Add debug output when a criterion is applied
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    rb95a5f r58316de  
    1226212262
    1226312263#ifdef HAVE_SHIFTBBA
     12264
     12265#ifdef KDEBUG
     12266#define CRITERION_DEBUG
     12267#endif
    1226412268/*2
    1226512269* put the pair (q,p)  into the set B, ecart=ecart(p), q is the shift of some s[i]
     
    1226712271void enterOnePairShift (poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS)
    1226812272{
     12273#ifdef CRITERION_DEBUG
     12274  Print("Consider pair (%s, %s)\n", pString(q), pString(p));
     12275  poly lmq = pHead(q);
     12276  poly lmp = pHead(p);
     12277  Print("    %s\n", pString(lmq));
     12278  Print("    %s\n", pString(lmp));
     12279  pLmDelete(lmq);
     12280  pLmDelete(lmp);
     12281#endif
    1226912282
    1227012283  /* Format: q and p are like strat->P.p, so lm in CR, tail in TR */
     
    1230412317
    1230512318  /* apply the V criterion */
    12306   if (!pIsInV(Lp.lcm))
     12319  if (!pmIsInV(Lp.lcm))
    1230712320  {
    1230812321#ifdef KDEBUG
     
    1231912332    /* + counter for applying the V criterion */
    1232012333    strat->cv++;
     12334#ifdef CRITERION_DEBUG
     12335    PrintS("--- V crit\n");
     12336#endif
    1232112337    return;
    1232212338  }
     
    1234312359      strat->cp++;
    1234412360      pLmFree(Lp.lcm);
     12361#ifdef CRITERION_DEBUG
     12362      PrintS("--- prod crit\n");
     12363#endif
    1234512364      return;
    1234612365    }
     
    1235012369    {
    1235112370      pLmFree(Lp.lcm);
     12371#ifdef CRITERION_DEBUG
     12372      PrintS("--- ecartq > ecart\n");
     12373#endif
    1235212374      return;
    1235312375      /*the pair is (s[i],t[.]), discard it if the ecart is too big*/
     
    1237212394          {
    1237312395            pLmFree(Lp.lcm);
     12396#ifdef CRITERION_DEBUG
     12397            Print("--- divided by B[%d]\n", j);
     12398#endif
    1237412399            return;
    1237512400          }
     
    1238112406        {
    1238212407          deleteInL(strat->B,&strat->Bl,j,strat);
     12408#ifdef CRITERION_DEBUG
     12409          Print("divides B[%d] -> delete B[%d]\n", j, j);
     12410#endif
    1238312411          strat->c3++;
    1238412412        }
     
    1241012438          strat->cp++;
    1241112439          pLmFree(Lp.lcm);
     12440#ifdef CRITERION_DEBUG
     12441          PrintS("--- prod crit\n");
     12442#endif
    1241212443          return;
    1241312444      }
     
    1241512446      {
    1241612447        pLmFree(Lp.lcm);
     12448#ifdef CRITERION_DEBUG
     12449        PrintS("--- ecartq > ecart\n");
     12450#endif
    1241712451        return;
    1241812452        /*the pair is (s[i],t[.]), discard it if the ecart is too big*/
     
    1243312467          {
    1243412468            pLmFree(Lp.lcm);
     12469#ifdef CRITERION_DEBUG
     12470            Print("--- divided by B[%d]\n", j);
     12471#endif
    1243512472            return;
    1243612473          }
     
    1244112478        {
    1244212479          deleteInL(strat->B,&strat->Bl,j,strat);
     12480#ifdef CRITERION_DEBUG
     12481          Print("divides B[%d] -> delete B[%d]\n", j, j);
     12482#endif
    1244312483          strat->c3++;
    1244412484        }
     
    1245312493    pNorm(p);
    1245412494  if ((q==NULL) || (p==NULL))
     12495  {
     12496#ifdef CRITERION_DEBUG
     12497    PrintS("--- q == NULL || p == NULL\n");
     12498#endif
    1245512499    return;
     12500  }
    1245612501  if ((strat->fromQ!=NULL) && (isFromQ!=0) && (qfromQ!=0))
     12502  {
    1245712503    Lp.p=NULL;
     12504#ifdef CRITERION_DEBUG
     12505    PrintS("--- pair from Q\n");
     12506#endif
     12507  }
    1245812508  else
    1245912509  {
     
    1251312563    */
    1251412564    if (Lp.lcm!=NULL) pLmFree(Lp.lcm);
     12565#ifdef CRITERION_DEBUG
     12566    PrintS("--- S-poly = 0\n");
     12567#endif
    1251512568  }
    1251612569  else
     
    1254912602    l = strat->posInL(strat->B,strat->Bl,&Lp,strat);
    1255012603    enterL(&strat->B,&strat->Bl,&strat->Bmax,Lp,l);
     12604#ifdef CRITERION_DEBUG
     12605    PrintS("+++ Entered pair\n");
     12606#endif
    1255112607  }
    1255212608}
Note: See TracChangeset for help on using the changeset viewer.