Changeset 308e89 in git for kernel/GBEngine/kutil.cc


Ignore:
Timestamp:
Dec 4, 2018, 4:34:29 PM (5 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
0f9a66a9eeed1c220023e0e344674bf38c5cca3c
Parents:
0d8474c9798429378aec577a8c711773955b699c
Message:
Pairs for rightGB
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    r0d8474c r308e89  
    1261012610    if (pGetComp(h)==0)
    1261112611    {
     12612      if (strat->rightGB)
     12613      {
     12614        if (isFromQ)
     12615        {
     12616          // pairs (shifts(h),s[1..k]), (h, s[1..k])
     12617          for (i=0; i<=maxShift; i++)
     12618          {
     12619            poly hh = pLPCopyAndShiftLM(h, i);
     12620            for (j=0; j<=k; j++)
     12621            {
     12622              if (strat->fromQ == NULL || !strat->fromQ[j])
     12623              {
     12624                new_pair=TRUE;
     12625                poly s = strat->S[j];
     12626                enterOnePairWithoutShifts(j, hh, s, ecart, isFromQ, strat, atR, pmLastVblock(s), i);
     12627              }
     12628            }
     12629          }
     12630        }
     12631        else
     12632        {
     12633          new_pair=TRUE;
     12634          for (j=0; j<=k; j++)
     12635          {
     12636            poly s = strat->S[j];
     12637            if (strat->fromQ != NULL && strat->fromQ[j])
     12638            {
     12639              // pairs (shifts(s[j]),h), (s[j],h)
     12640              enterOnePairWithShifts(j, s, h, ecart, isFromQ, strat, atR, h_lastVblock, pmLastVblock(s));
     12641            }
     12642            else
     12643            {
     12644              // pair (h, s[j])
     12645              enterOnePairWithoutShifts(j, h, s, ecart, isFromQ, strat, atR, pmLastVblock(s), 0);
     12646            }
     12647          }
     12648        }
     12649      }
    1261212650      /* for Q!=NULL: build pairs (f,q),(f1,f2), but not (q1,q2)*/
    12613       if ((isFromQ)&&(strat->fromQ!=NULL))
     12651      else if ((isFromQ)&&(strat->fromQ!=NULL))
    1261412652      {
    1261512653        // pairs (shifts(s[1..k]),h), (s[1..k],h)
     
    1266412702    {
    1266512703      new_pair=TRUE;
    12666       // pairs (shifts(s[1..k]),h), (s[1..k],h)
    12667       for (j=0; j<=k; j++) {
    12668         if ((pGetComp(h)==pGetComp(strat->S[j]))
    12669         || (pGetComp(strat->S[j])==0))
    12670         {
    12671           poly s = strat->S[j];
    12672           enterOnePairWithShifts(j, s, h, ecart, isFromQ, strat, atR, h_lastVblock, pmLastVblock(s));
    12673         }
    12674       }
    12675       // pairs (shifts(h),s[1..k]), (shifts(h), h)
    12676       for (i=1; i<=maxShift; i++)
    12677       {
    12678         poly hh = pLPCopyAndShiftLM(h, i);
     12704      if (strat->rightGB)
     12705      {
    1267912706        for (j=0; j<=k; j++)
    1268012707        {
    1268112708          if ((pGetComp(h)==pGetComp(strat->S[j]))
    12682           || (pGetComp(strat->S[j])==0))
     12709              || (pGetComp(strat->S[j])==0))
     12710          {
     12711            assume(isFromQ == 0); // this case is not handeled here and should also never happen
     12712            poly s = strat->S[j];
     12713            if (strat->fromQ != NULL && strat->fromQ[j])
     12714            {
     12715              // pairs (shifts(s[j]),h), (s[j],h)
     12716              enterOnePairWithShifts(j, s, h, ecart, isFromQ, strat, atR, h_lastVblock, pmLastVblock(s));
     12717            }
     12718            else
     12719            {
     12720              // pair (h, s[j])
     12721              enterOnePairWithoutShifts(j, h, s, ecart, isFromQ, strat, atR, pmLastVblock(s), 0);
     12722            }
     12723          }
     12724        }
     12725      }
     12726      else
     12727      {
     12728        // pairs (shifts(s[1..k]),h), (s[1..k],h)
     12729        for (j=0; j<=k; j++) {
     12730          if ((pGetComp(h)==pGetComp(strat->S[j]))
     12731              || (pGetComp(strat->S[j])==0))
    1268312732          {
    1268412733            poly s = strat->S[j];
    12685             enterOnePairWithoutShifts(j, hh, s, ecart, isFromQ, strat, atR, pmLastVblock(s), i);
     12734            enterOnePairWithShifts(j, s, h, ecart, isFromQ, strat, atR, h_lastVblock, pmLastVblock(s));
    1268612735          }
    1268712736        }
    12688         enterOnePairWithoutShifts(-1, hh, h, ecart, isFromQ, strat, atR, h_lastVblock, i);
     12737        // pairs (shifts(h),s[1..k]), (shifts(h), h)
     12738        for (i=1; i<=maxShift; i++)
     12739        {
     12740          poly hh = pLPCopyAndShiftLM(h, i);
     12741          for (j=0; j<=k; j++)
     12742          {
     12743            if ((pGetComp(h)==pGetComp(strat->S[j]))
     12744                || (pGetComp(strat->S[j])==0))
     12745            {
     12746              poly s = strat->S[j];
     12747              enterOnePairWithoutShifts(j, hh, s, ecart, isFromQ, strat, atR, pmLastVblock(s), i);
     12748            }
     12749          }
     12750          enterOnePairWithoutShifts(-1, hh, h, ecart, isFromQ, strat, atR, h_lastVblock, i);
     12751        }
    1268912752      }
    1269012753    }
     
    1272112784      if (j > k) break;
    1272212785      // TODO this currently doesn't clear all possible elements because of commutative division
    12723       // for rightGB this is already correct
    12724       clearS(h,h_sev, &j,&k,strat);
     12786      if (!(strat->rightGB && strat->fromQ != NULL && strat->fromQ[j]))
     12787        clearS(h,h_sev, &j,&k,strat);
    1272512788      j++;
    1272612789    }
Note: See TracChangeset for help on using the changeset viewer.