Changeset 0d8474c in git for kernel


Ignore:
Timestamp:
Dec 4, 2018, 4:25:34 PM (5 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
308e89cd3835b81bfc0e9f0dbd5450159e27cad4
Parents:
f4245d4d5a8b5328234382a5c5cf906631971ade
Message:
Better debugging for pairs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    rf4245d r0d8474c  
    1226312263{
    1226412264#ifdef CRITERION_DEBUG
    12265   Print("Consider pair (%s, %s)\n", pString(q), pString(p));
    12266   // also write the LMs in separate lines:
    12267   poly lmq = pHead(q);
    12268   poly lmp = pHead(p);
    12269   pSetCoeff(lmq, n_Init(1, currRing->cf));
    12270   pSetCoeff(lmp, n_Init(1, currRing->cf));
    12271   Print("    %s\n", pString(lmq));
    12272   Print("    %s\n", pString(lmp));
    12273   pLmDelete(lmq);
    12274   pLmDelete(lmp);
     12265  if (TEST_OPT_DEBUG)
     12266  {
     12267    PrintS("Consider pair ("); wrp(q); PrintS(", "); wrp(p); PrintS(")"); PrintLn();
     12268    // also write the LMs in separate lines:
     12269    poly lmq = pHead(q);
     12270    poly lmp = pHead(p);
     12271    pSetCoeff(lmq, n_Init(1, currRing->cf));
     12272    pSetCoeff(lmp, n_Init(1, currRing->cf));
     12273    Print("    %s\n", pString(lmq));
     12274    Print("    %s\n", pString(lmp));
     12275    pLmDelete(lmq);
     12276    pLmDelete(lmp);
     12277  }
    1227512278#endif
    1227612279
     
    1228312286  assume(p_CheckIsFromRing(pNext(p),strat->tailRing));
    1228412287
    12285 #ifdef KDEBUG
    12286 //    if (TEST_OPT_DEBUG)
    12287 //    {
    12288 //       PrintS("enterOnePairShift(q,p) invoked with q = ");
    12289 //       wrp(q); //      wrp(pHead(q));
    12290 //       PrintS(", p = ");
    12291 //       wrp(p); //wrp(pHead(p));
    12292 //       PrintLn();
    12293 //    }
    12294 #endif
    12295 
    1229612288  /* poly q stays for s[i], ecartq = ecart(q), qisFromQ = applies to q */
    1229712289
     
    1231012302  Lp.lcm = p_Lcm(p,q, currRing); // q is what was strat->S[i], so a poly in LM/TR presentation
    1231112303
    12312   /* apply the V criterion */
     12304  /* the V criterion */
    1231312305  if (!pmIsInV(Lp.lcm))
    1231412306  {
    12315 #ifdef KDEBUG
    12316     if (TEST_OPT_DEBUG)
    12317     {
    12318       PrintS("V crit applied to q = ");
    12319       wrp(q); //      wrp(pHead(q));
    12320       PrintS(", p = ");
    12321       wrp(p); //wrp(pHead(p));
    12322       PrintLn();
    12323     }
    12324 #endif
     12307    strat->cv++; // counter for applying the V criterion
    1232512308    pLmFree(Lp.lcm);
    12326     /* + counter for applying the V criterion */
    12327     strat->cv++;
    1232812309#ifdef CRITERION_DEBUG
    12329     PrintS("--- V crit\n");
     12310    if (TEST_OPT_DEBUG) PrintS("--- V crit\n");
    1233012311#endif
    1233112312    return;
     
    1235412335      pLmFree(Lp.lcm);
    1235512336#ifdef CRITERION_DEBUG
    12356       PrintS("--- prod crit\n");
     12337      if (TEST_OPT_DEBUG) PrintS("--- prod crit\n");
    1235712338#endif
    1235812339      return;
     
    1236412345      pLmFree(Lp.lcm);
    1236512346#ifdef CRITERION_DEBUG
    12366       PrintS("--- ecartq > ecart\n");
     12347      if (TEST_OPT_DEBUG) PrintS("--- ecartq > ecart\n");
    1236712348#endif
    1236812349      return;
     
    1238912370            pLmFree(Lp.lcm);
    1239012371#ifdef CRITERION_DEBUG
    12391             Print("--- divided by B[%d]\n", j);
     12372            if (TEST_OPT_DEBUG) Print("--- divided by B[%d]\n", j);
    1239212373#endif
    1239312374            return;
     
    1240112382          deleteInL(strat->B,&strat->Bl,j,strat);
    1240212383#ifdef CRITERION_DEBUG
    12403           Print("divides B[%d] -> delete B[%d]\n", j, j);
     12384          if (TEST_OPT_DEBUG) Print("divides B[%d] -> delete B[%d]\n", j, j);
    1240412385#endif
    1240512386          strat->c3++;
     
    1243312414          pLmFree(Lp.lcm);
    1243412415#ifdef CRITERION_DEBUG
    12435           PrintS("--- prod crit\n");
     12416          if (TEST_OPT_DEBUG) PrintS("--- prod crit\n");
    1243612417#endif
    1243712418          return;
     
    1244112422        pLmFree(Lp.lcm);
    1244212423#ifdef CRITERION_DEBUG
    12443         PrintS("--- ecartq > ecart\n");
     12424        if (TEST_OPT_DEBUG) PrintS("--- ecartq > ecart\n");
    1244412425#endif
    1244512426        return;
     
    1246212443            pLmFree(Lp.lcm);
    1246312444#ifdef CRITERION_DEBUG
    12464             Print("--- divided by B[%d]\n", j);
     12445            if (TEST_OPT_DEBUG) Print("--- divided by B[%d]\n", j);
    1246512446#endif
    1246612447            return;
     
    1247312454          deleteInL(strat->B,&strat->Bl,j,strat);
    1247412455#ifdef CRITERION_DEBUG
    12475           Print("divides B[%d] -> delete B[%d]\n", j, j);
     12456          if (TEST_OPT_DEBUG) Print("divides B[%d] -> delete B[%d]\n", j, j);
    1247612457#endif
    1247712458          strat->c3++;
     
    1248912470  {
    1249012471#ifdef CRITERION_DEBUG
    12491     PrintS("--- q == NULL || p == NULL\n");
     12472    if (TEST_OPT_DEBUG) PrintS("--- q == NULL || p == NULL\n");
    1249212473#endif
    1249312474    return;
     
    1249712478    Lp.p=NULL;
    1249812479#ifdef CRITERION_DEBUG
    12499     PrintS("--- pair from Q\n");
     12480    if (TEST_OPT_DEBUG) PrintS("--- pair from Q\n");
    1250012481#endif
    1250112482  }
     
    1255812539    if (Lp.lcm!=NULL) pLmFree(Lp.lcm);
    1255912540#ifdef CRITERION_DEBUG
    12560     PrintS("--- S-poly = 0\n");
     12541    if (TEST_OPT_DEBUG) PrintS("--- S-poly = 0\n");
    1256112542#endif
    1256212543  }
     
    1259712578    enterL(&strat->B,&strat->Bl,&strat->Bmax,Lp,l);
    1259812579#ifdef CRITERION_DEBUG
    12599     PrintS("+++ Entered pair\n");
     12580    if (TEST_OPT_DEBUG) PrintS("+++ Entered pair\n");
    1260012581#endif
    1260112582  }
Note: See TracChangeset for help on using the changeset viewer.