Changeset 2d10479 in git


Ignore:
Timestamp:
Aug 23, 2022, 4:16:59 PM (20 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
d8e71ad3b7da00ac57fd1a2bf76f769d0f67b51a
Parents:
1b2b4f8ec37dce1b2d0ca0320a314de60210c41b
Message:
format and printf for debug stuff
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    r1b2b4f r2d10479  
    70457045        if (j > end_pos) return NULL;
    70467046  #if defined(PDEBUG) || defined(PDIV_DEBUG)
    7047         if (strat->S[j]!= NULL && p_LmShortDivisibleBy(strat->S[j], sev[j], p, not_sev, r) &&
    7048             (ecart== LONG_MAX || ecart>= strat->ecartS[j]) && n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), r->cf))
    7049         {
    7050           break;
     7047        if (strat->S[j]!= NULL
     7048        && p_LmShortDivisibleBy(strat->S[j], sev[j], p, not_sev, r)
     7049        && (ecart== LONG_MAX || ecart>= strat->ecartS[j])
     7050        && n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), r->cf))
     7051        {
     7052          break; // found
    70517053        }
    70527054  #else
    7053         if (!(sev[j] & not_sev) &&
    7054             (ecart== LONG_MAX || ecart>= strat->ecartS[j]) &&
    7055             p_LmDivisibleBy(strat->S[j], p, r) && n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), r->cf))
    7056         {
    7057           break;
     7055        if (!(sev[j] & not_sev)
     7056        && (ecart== LONG_MAX || ecart>= strat->ecartS[j])
     7057        && p_LmDivisibleBy(strat->S[j], p, r)
     7058        && n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), r->cf))
     7059        {
     7060          break; // found
    70587061        }
    70597062  #endif
     
    70897092        t = strat->S_2_T(j);
    70907093        assume(t != NULL && t->t_p != NULL && t->tailRing == r);
    7091         if (p_LmShortDivisibleBy(t->t_p, sev[j], p, not_sev, r) &&
    7092             (ecart== LONG_MAX || ecart>= strat->ecartS[j]))
     7094        if (p_LmShortDivisibleBy(t->t_p, sev[j], p, not_sev, r)
     7095        && (ecart== LONG_MAX || ecart>= strat->ecartS[j]))
    70937096        {
    70947097          t->pLength=pLength(t->t_p);
     
    70967099        }
    70977100  #else
    7098         if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->ecartS[j]))
     7101        if (! (sev[j] & not_sev)
     7102        && (ecart== LONG_MAX || ecart>= strat->ecartS[j]))
    70997103        {
    71007104          t = strat->S_2_T(j);
     
    71207124        t = strat->S_2_T(j);
    71217125        assume(t != NULL && t->t_p != NULL && t->tailRing == r);
    7122         if (p_LmShortDivisibleBy(t->t_p, sev[j], p, not_sev, r) &&
    7123             (ecart== LONG_MAX || ecart>= strat->ecartS[j]) && n_DivBy(pGetCoeff(p), pGetCoeff(t->t_p), r->cf))
     7126        if (p_LmShortDivisibleBy(t->t_p, sev[j], p, not_sev, r)
     7127        && (ecart== LONG_MAX || ecart>= strat->ecartS[j])
     7128        && n_DivBy(pGetCoeff(p), pGetCoeff(t->t_p), r->cf))
    71247129        {
    71257130          t->pLength=pLength(t->t_p);
     
    71277132        }
    71287133  #else
    7129         if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->ecartS[j]))
     7134        if (! (sev[j] & not_sev)
     7135        && (ecart== LONG_MAX || ecart>= strat->ecartS[j]))
    71307136        {
    71317137          t = strat->S_2_T(j);
    71327138          assume(t != NULL && t->t_p != NULL && t->tailRing == r && t->p == strat->S[j]);
    7133           if (p_LmDivisibleBy(t->t_p, p, r) && n_DivBy(pGetCoeff(p), pGetCoeff(t->t_p), r->cf))
     7139          if (p_LmDivisibleBy(t->t_p, p, r)
     7140          && n_DivBy(pGetCoeff(p), pGetCoeff(t->t_p), r->cf))
    71347141          {
    71357142            t->pLength=pLength(t->t_p);
     
    1183311840void kDebugPrint(kStrategy strat)
    1183411841{
    11835   PrintS("red: ");
    11836     if (strat->red==redFirst) PrintS("redFirst\n");
    11837     else if (strat->red==redHoney) PrintS("redHoney\n");
    11838     else if (strat->red==redEcart) PrintS("redEcart\n");
    11839     else if (strat->red==redHomog) PrintS("redHomog\n");
    11840     else if (strat->red==redLazy) PrintS("redLazy\n");
    11841     else if (strat->red==redLiftstd) PrintS("redLiftstd\n");
    11842     else  Print("%p\n",(void*)strat->red);
    11843   PrintS("posInT: ");
    11844     if (strat->posInT==posInT0) PrintS("posInT0\n");
    11845     else if (strat->posInT==posInT1) PrintS("posInT1\n");
    11846     else if (strat->posInT==posInT11) PrintS("posInT11\n");
    11847     else if (strat->posInT==posInT110) PrintS("posInT110\n");
    11848     else if (strat->posInT==posInT13) PrintS("posInT13\n");
    11849     else if (strat->posInT==posInT15) PrintS("posInT15\n");
    11850     else if (strat->posInT==posInT17) PrintS("posInT17\n");
    11851     else if (strat->posInT==posInT17_c) PrintS("posInT17_c\n");
    11852     else if (strat->posInT==posInT19) PrintS("posInT19\n");
    11853     else if (strat->posInT==posInT2) PrintS("posInT2\n");
     11842  printf("red: ");
     11843    if (strat->red==redFirst) printf("redFirst\n");
     11844    else if (strat->red==redHoney) printf("redHoney\n");
     11845    else if (strat->red==redEcart) printf("redEcart\n");
     11846    else if (strat->red==redHomog) printf("redHomog\n");
     11847    else if (strat->red==redLazy) printf("redLazy\n");
     11848    else if (strat->red==redLiftstd) printf("redLiftstd\n");
     11849    else  printf("%p\n",(void*)strat->red);
     11850  printf("posInT: ");
     11851    if (strat->posInT==posInT0) printf("posInT0\n");
     11852    else if (strat->posInT==posInT1) printf("posInT1\n");
     11853    else if (strat->posInT==posInT11) printf("posInT11\n");
     11854    else if (strat->posInT==posInT110) printf("posInT110\n");
     11855    else if (strat->posInT==posInT13) printf("posInT13\n");
     11856    else if (strat->posInT==posInT15) printf("posInT15\n");
     11857    else if (strat->posInT==posInT17) printf("posInT17\n");
     11858    else if (strat->posInT==posInT17_c) printf("posInT17_c\n");
     11859    else if (strat->posInT==posInT19) printf("posInT19\n");
     11860    else if (strat->posInT==posInT2) printf("posInT2\n");
    1185411861    #ifdef HAVE_RINGS
    11855     else if (strat->posInT==posInT11Ring) PrintS("posInT11Ring\n");
    11856     else if (strat->posInT==posInT110Ring) PrintS("posInT110Ring\n");
    11857     else if (strat->posInT==posInT15Ring) PrintS("posInT15Ring\n");
    11858     else if (strat->posInT==posInT17Ring) PrintS("posInT17Ring\n");
    11859     else if (strat->posInT==posInT17_cRing) PrintS("posInT17_cRing\n");
     11862    else if (strat->posInT==posInT11Ring) printf("posInT11Ring\n");
     11863    else if (strat->posInT==posInT110Ring) printf("posInT110Ring\n");
     11864    else if (strat->posInT==posInT15Ring) printf("posInT15Ring\n");
     11865    else if (strat->posInT==posInT17Ring) printf("posInT17Ring\n");
     11866    else if (strat->posInT==posInT17_cRing) printf("posInT17_cRing\n");
    1186011867    #endif
    1186111868#ifdef HAVE_MORE_POS_IN_T
    11862     else if (strat->posInT==posInT_EcartFDegpLength) PrintS("posInT_EcartFDegpLength\n");
    11863     else if (strat->posInT==posInT_FDegpLength) PrintS("posInT_FDegpLength\n");
    11864     else if (strat->posInT==posInT_pLength) PrintS("posInT_pLength\n");
    11865 #endif
    11866     else if (strat->posInT==posInT_EcartpLength) PrintS("posInT_EcartpLength\n");
    11867     else if (strat->posInT==posInTrg0) PrintS("posInTrg0\n");
    11868     else  Print("%p\n",(void*)strat->posInT);
    11869   PrintS("posInL: ");
    11870     if (strat->posInL==posInL0) PrintS("posInL0\n");
    11871     else if (strat->posInL==posInL10) PrintS("posInL10\n");
    11872     else if (strat->posInL==posInL11) PrintS("posInL11\n");
    11873     else if (strat->posInL==posInL110) PrintS("posInL110\n");
    11874     else if (strat->posInL==posInL13) PrintS("posInL13\n");
    11875     else if (strat->posInL==posInL15) PrintS("posInL15\n");
    11876     else if (strat->posInL==posInL17) PrintS("posInL17\n");
    11877     else if (strat->posInL==posInL17_c) PrintS("posInL17_c\n");
     11869    else if (strat->posInT==posInT_EcartFDegpLength) printf("posInT_EcartFDegpLength\n");
     11870    else if (strat->posInT==posInT_FDegpLength) printf("posInT_FDegpLength\n");
     11871    else if (strat->posInT==posInT_pLength) printf("posInT_pLength\n");
     11872#endif
     11873    else if (strat->posInT==posInT_EcartpLength) printf("posInT_EcartpLength\n");
     11874    else if (strat->posInT==posInTrg0) printf("posInTrg0\n");
     11875    else  printf("%p\n",(void*)strat->posInT);
     11876  printf("posInL: ");
     11877    if (strat->posInL==posInL0) printf("posInL0\n");
     11878    else if (strat->posInL==posInL10) printf("posInL10\n");
     11879    else if (strat->posInL==posInL11) printf("posInL11\n");
     11880    else if (strat->posInL==posInL110) printf("posInL110\n");
     11881    else if (strat->posInL==posInL13) printf("posInL13\n");
     11882    else if (strat->posInL==posInL15) printf("posInL15\n");
     11883    else if (strat->posInL==posInL17) printf("posInL17\n");
     11884    else if (strat->posInL==posInL17_c) printf("posInL17_c\n");
    1187811885    #ifdef HAVE_RINGS
    11879     else if (strat->posInL==posInL0) PrintS("posInL0Ring\n");
    11880     else if (strat->posInL==posInL11Ring) PrintS("posInL11Ring\n");
    11881     else if (strat->posInL==posInL11Ringls) PrintS("posInL11Ringls\n");
    11882     else if (strat->posInL==posInL110Ring) PrintS("posInL110Ring\n");
    11883     else if (strat->posInL==posInL15Ring) PrintS("posInL15Ring\n");
    11884     else if (strat->posInL==posInL17Ring) PrintS("posInL17Ring\n");
    11885     else if (strat->posInL==posInL17_cRing) PrintS("posInL17_cRing\n");
     11886    else if (strat->posInL==posInL0) printf("posInL0Ring\n");
     11887    else if (strat->posInL==posInL11Ring) printf("posInL11Ring\n");
     11888    else if (strat->posInL==posInL11Ringls) printf("posInL11Ringls\n");
     11889    else if (strat->posInL==posInL110Ring) printf("posInL110Ring\n");
     11890    else if (strat->posInL==posInL15Ring) printf("posInL15Ring\n");
     11891    else if (strat->posInL==posInL17Ring) printf("posInL17Ring\n");
     11892    else if (strat->posInL==posInL17_cRing) printf("posInL17_cRing\n");
    1188611893    #endif
    11887     else if (strat->posInL==posInLSpecial) PrintS("posInLSpecial\n");
    11888     else if (strat->posInL==posInLrg0) PrintS("posInLrg0\n");
    11889     else  Print("%p\n",(void*)strat->posInL);
    11890   PrintS("enterS: ");
    11891     if (strat->enterS==enterSBba) PrintS("enterSBba\n");
    11892     else if (strat->enterS==enterSMora) PrintS("enterSMora\n");
    11893     else if (strat->enterS==enterSMoraNF) PrintS("enterSMoraNF\n");
    11894     else  Print("%p\n",(void*)strat->enterS);
    11895   PrintS("initEcart: ");
    11896     if (strat->initEcart==initEcartBBA) PrintS("initEcartBBA\n");
    11897     else if (strat->initEcart==initEcartNormal) PrintS("initEcartNormal\n");
    11898     else  Print("%p\n",(void*)strat->initEcart);
    11899   PrintS("initEcartPair: ");
    11900     if (strat->initEcartPair==initEcartPairBba) PrintS("initEcartPairBba\n");
    11901     else if (strat->initEcartPair==initEcartPairMora) PrintS("initEcartPairMora\n");
    11902     else  Print("%p\n",(void*)strat->initEcartPair);
    11903   Print("homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
     11894    else if (strat->posInL==posInLSpecial) printf("posInLSpecial\n");
     11895    else if (strat->posInL==posInLrg0) printf("posInLrg0\n");
     11896    else  printf("%p\n",(void*)strat->posInL);
     11897  printf("enterS: ");
     11898    if (strat->enterS==enterSBba) printf("enterSBba\n");
     11899    else if (strat->enterS==enterSMora) printf("enterSMora\n");
     11900    else if (strat->enterS==enterSMoraNF) printf("enterSMoraNF\n");
     11901    else  printf("%p\n",(void*)strat->enterS);
     11902  printf("initEcart: ");
     11903    if (strat->initEcart==initEcartBBA) printf("initEcartBBA\n");
     11904    else if (strat->initEcart==initEcartNormal) printf("initEcartNormal\n");
     11905    else  printf("%p\n",(void*)strat->initEcart);
     11906  printf("initEcartPair: ");
     11907    if (strat->initEcartPair==initEcartPairBba) printf("initEcartPairBba\n");
     11908    else if (strat->initEcartPair==initEcartPairMora) printf("initEcartPairMora\n");
     11909    else  printf("%p\n",(void*)strat->initEcartPair);
     11910  printf("homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
    1190411911    strat->homog, strat->LazyDegree,strat->LazyPass, strat->ak);
    11905   Print("honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
     11912  printf("honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
    1190611913    strat->honey,strat->sugarCrit,strat->Gebauer,strat->noTailReduction,strat->use_buckets);
    11907   PrintS("chainCrit: ");
    11908     if (strat->chainCrit==chainCritNormal) PrintS("chainCritNormal\n");
    11909     else if (strat->chainCrit==chainCritOpt_1) PrintS("chainCritOpt_1\n");
    11910     else  Print("%p\n",(void*)strat->chainCrit);
    11911   Print("posInLDependsOnLength=%d\n",
     11914  printf("chainCrit: ");
     11915    if (strat->chainCrit==chainCritNormal) printf("chainCritNormal\n");
     11916    else if (strat->chainCrit==chainCritOpt_1) printf("chainCritOpt_1\n");
     11917    else  printf("%p\n",(void*)strat->chainCrit);
     11918  printf("posInLDependsOnLength=%d\n",
    1191211919         strat->posInLDependsOnLength);
    11913   PrintS(showOption());PrintLn();
    11914   PrintS("LDeg: ");
    11915     if (currRing->pLDeg==pLDeg0) PrintS("pLDeg0");
    11916     else if (currRing->pLDeg==pLDeg0c) PrintS("pLDeg0c");
    11917     else if (currRing->pLDeg==pLDegb) PrintS("pLDegb");
    11918     else if (currRing->pLDeg==pLDeg1) PrintS("pLDeg1");
    11919     else if (currRing->pLDeg==pLDeg1c) PrintS("pLDeg1c");
    11920     else if (currRing->pLDeg==pLDeg1_Deg) PrintS("pLDeg1_Deg");
    11921     else if (currRing->pLDeg==pLDeg1c_Deg) PrintS("pLDeg1c_Deg");
    11922     else if (currRing->pLDeg==pLDeg1_Totaldegree) PrintS("pLDeg1_Totaldegree");
    11923     else if (currRing->pLDeg==pLDeg1c_Totaldegree) PrintS("pLDeg1c_Totaldegree");
    11924     else if (currRing->pLDeg==pLDeg1_WFirstTotalDegree) PrintS("pLDeg1_WFirstTotalDegree");
    11925     else if (currRing->pLDeg==pLDeg1c_WFirstTotalDegree) PrintS("pLDeg1c_WFirstTotalDegree");
    11926     else if (currRing->pLDeg==maxdegreeWecart) PrintS("maxdegreeWecart");
    11927     else Print("? (%lx)", (long)currRing->pLDeg);
    11928     PrintS(" / ");
    11929     if (strat->tailRing->pLDeg==pLDeg0) PrintS("pLDeg0");
    11930     else if (strat->tailRing->pLDeg==pLDeg0c) PrintS("pLDeg0c");
    11931     else if (strat->tailRing->pLDeg==pLDegb) PrintS("pLDegb");
    11932     else if (strat->tailRing->pLDeg==pLDeg1) PrintS("pLDeg1");
    11933     else if (strat->tailRing->pLDeg==pLDeg1c) PrintS("pLDeg1c");
    11934     else if (strat->tailRing->pLDeg==pLDeg1_Deg) PrintS("pLDeg1_Deg");
    11935     else if (strat->tailRing->pLDeg==pLDeg1c_Deg) PrintS("pLDeg1c_Deg");
    11936     else if (strat->tailRing->pLDeg==pLDeg1_Totaldegree) PrintS("pLDeg1_Totaldegree");
    11937     else if (strat->tailRing->pLDeg==pLDeg1c_Totaldegree) PrintS("pLDeg1c_Totaldegree");
    11938     else if (strat->tailRing->pLDeg==pLDeg1_WFirstTotalDegree) PrintS("pLDeg1_WFirstTotalDegree");
    11939     else if (strat->tailRing->pLDeg==pLDeg1c_WFirstTotalDegree) PrintS("pLDeg1c_WFirstTotalDegree");
    11940     else if (strat->tailRing->pLDeg==maxdegreeWecart) PrintS("maxdegreeWecart");
    11941     else Print("? (%lx)", (long)strat->tailRing->pLDeg);
    11942     PrintLn();
    11943   PrintS("currRing->pFDeg: ");
    11944     if (currRing->pFDeg==p_Totaldegree) PrintS("p_Totaldegree");
    11945     else if (currRing->pFDeg==p_WFirstTotalDegree) PrintS("pWFirstTotalDegree");
    11946     else if (currRing->pFDeg==p_Deg) PrintS("p_Deg");
    11947     else if (currRing->pFDeg==kHomModDeg) PrintS("kHomModDeg");
    11948     else if (currRing->pFDeg==totaldegreeWecart) PrintS("totaldegreeWecart");
    11949     else if (currRing->pFDeg==p_WTotaldegree) PrintS("p_WTotaldegree");
    11950     else Print("? (%lx)", (long)currRing->pFDeg);
    11951     PrintLn();
    11952     Print(" syzring:%d, syzComp(strat):%d limit:%d\n",rIsSyzIndexRing(currRing),strat->syzComp,rGetCurrSyzLimit(currRing));
     11920  printf(showOption());printf("\n");
     11921  printf("LDeg: ");
     11922    if (currRing->pLDeg==pLDeg0) printf("pLDeg0");
     11923    else if (currRing->pLDeg==pLDeg0c) printf("pLDeg0c");
     11924    else if (currRing->pLDeg==pLDegb) printf("pLDegb");
     11925    else if (currRing->pLDeg==pLDeg1) printf("pLDeg1");
     11926    else if (currRing->pLDeg==pLDeg1c) printf("pLDeg1c");
     11927    else if (currRing->pLDeg==pLDeg1_Deg) printf("pLDeg1_Deg");
     11928    else if (currRing->pLDeg==pLDeg1c_Deg) printf("pLDeg1c_Deg");
     11929    else if (currRing->pLDeg==pLDeg1_Totaldegree) printf("pLDeg1_Totaldegree");
     11930    else if (currRing->pLDeg==pLDeg1c_Totaldegree) printf("pLDeg1c_Totaldegree");
     11931    else if (currRing->pLDeg==pLDeg1_WFirstTotalDegree) printf("pLDeg1_WFirstTotalDegree");
     11932    else if (currRing->pLDeg==pLDeg1c_WFirstTotalDegree) printf("pLDeg1c_WFirstTotalDegree");
     11933    else if (currRing->pLDeg==maxdegreeWecart) printf("maxdegreeWecart");
     11934    else printf("? (%lx)", (long)currRing->pLDeg);
     11935    printf(" / ");
     11936    if (strat->tailRing->pLDeg==pLDeg0) printf("pLDeg0");
     11937    else if (strat->tailRing->pLDeg==pLDeg0c) printf("pLDeg0c");
     11938    else if (strat->tailRing->pLDeg==pLDegb) printf("pLDegb");
     11939    else if (strat->tailRing->pLDeg==pLDeg1) printf("pLDeg1");
     11940    else if (strat->tailRing->pLDeg==pLDeg1c) printf("pLDeg1c");
     11941    else if (strat->tailRing->pLDeg==pLDeg1_Deg) printf("pLDeg1_Deg");
     11942    else if (strat->tailRing->pLDeg==pLDeg1c_Deg) printf("pLDeg1c_Deg");
     11943    else if (strat->tailRing->pLDeg==pLDeg1_Totaldegree) printf("pLDeg1_Totaldegree");
     11944    else if (strat->tailRing->pLDeg==pLDeg1c_Totaldegree) printf("pLDeg1c_Totaldegree");
     11945    else if (strat->tailRing->pLDeg==pLDeg1_WFirstTotalDegree) printf("pLDeg1_WFirstTotalDegree");
     11946    else if (strat->tailRing->pLDeg==pLDeg1c_WFirstTotalDegree) printf("pLDeg1c_WFirstTotalDegree");
     11947    else if (strat->tailRing->pLDeg==maxdegreeWecart) printf("maxdegreeWecart");
     11948    else printf("? (%lx)", (long)strat->tailRing->pLDeg);
     11949    printf("\n");
     11950  printf("currRing->pFDeg: ");
     11951    if (currRing->pFDeg==p_Totaldegree) printf("p_Totaldegree");
     11952    else if (currRing->pFDeg==p_WFirstTotalDegree) printf("pWFirstTotalDegree");
     11953    else if (currRing->pFDeg==p_Deg) printf("p_Deg");
     11954    else if (currRing->pFDeg==kHomModDeg) printf("kHomModDeg");
     11955    else if (currRing->pFDeg==totaldegreeWecart) printf("totaldegreeWecart");
     11956    else if (currRing->pFDeg==p_WTotaldegree) printf("p_WTotaldegree");
     11957    else printf("? (%lx)", (long)currRing->pFDeg);
     11958    printf("\n");
     11959    printf(" syzring:%d, syzComp(strat):%d limit:%d\n",rIsSyzIndexRing(currRing),strat->syzComp,rGetCurrSyzLimit(currRing));
    1195311960    if(TEST_OPT_DEGBOUND)
    11954       Print(" degBound: %d\n", Kstd1_deg);
     11961      printf(" degBound: %d\n", Kstd1_deg);
    1195511962
    1195611963    if( ecartWeights != NULL )
    1195711964    {
    11958        PrintS("ecartWeights: ");
     11965       printf("ecartWeights: ");
    1195911966       for (int i = rVar(currRing); i > 0; i--)
    11960          Print("%hd ", ecartWeights[i]);
    11961        PrintLn();
     11967         printf("%hd ", ecartWeights[i]);
     11968       printf("\n");
    1196211969       assume( TEST_OPT_WEIGHTM );
    1196311970    }
Note: See TracChangeset for help on using the changeset viewer.