Changeset 83f82e5 in git


Ignore:
Timestamp:
Oct 5, 2018, 12:08:36 PM (6 years ago)
Author:
Christian Eder
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
3b1ebbd6601fe3c4fc0b0d4b475b35d8b831fbba
Parents:
85fb25bbf3405cac363858b74d2615e61408f47b
git-author:
Christian Eder <ederc@mathematik.uni-kl.de>2018-10-05 12:08:36+02:00
git-committer:
Christian Eder <ederc@mathematik.uni-kl.de>2018-10-05 12:37:42+02:00
Message:
adds replacement function for L, S, and T
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    r85fb25 r83f82e5  
    96569656* puts p to the set T at position atT
    96579657*/
     9658void replaceInLAndSAndT(LObject &p, kStrategy strat, int pos)
     9659{
     9660  p.GetP(strat->lmBin);
     9661  if (strat->homog) strat->initEcart(&p);
     9662      strat->redTailChange=FALSE;
     9663      if ((TEST_OPT_INTSTRATEGY) || (rField_is_Ring(currRing)))
     9664      {
     9665        p.pCleardenom();
     9666        if ((TEST_OPT_REDSB)||(TEST_OPT_REDTAIL))
     9667        {
     9668          p.p = redtailBba(&p,strat->sl,strat, FALSE,!TEST_OPT_CONTENTSB);
     9669          p.pCleardenom();
     9670          if (strat->redTailChange) { p.t_p=NULL; }
     9671        }
     9672      }
     9673
     9674  assume(strat->tailRing == p.tailRing);
     9675  assume(p.pLength == 0 || pLength(p.p) == p.pLength || rIsSyzIndexRing(currRing)); // modulo syzring
     9676
     9677  int i, j, posS, irpos;
     9678
     9679  irpos = strat->T[pos].i_r;
     9680  posS  = posInS(strat, strat->sl, p.p, p.ecart);
     9681  clearSbatch(p.p, strat->sl, posS, strat);
     9682  pp_Test(p.p, currRing, p.tailRing);
     9683  assume(p.FDeg == p.pFDeg());
     9684  assume(!p.is_normalized || nIsOne(pGetCoeff(p.p)));
     9685
     9686  if (currRing != strat->tailRing) {
     9687      p.t_p = p.GetLmTailRing();
     9688  }
     9689  if ((strat->tailBin != NULL) && (pNext(p.p) != NULL))
     9690  {
     9691    pNext(p.p)=p_ShallowCopyDelete(pNext(p.p),
     9692                                   (strat->tailRing != NULL ?
     9693                                    strat->tailRing : currRing),
     9694                                   strat->tailBin);
     9695    if (p.t_p != NULL) pNext(p.t_p) = pNext(p.p);
     9696  }
     9697  /* replace all pairs where p.p appears as a generator */
     9698  for (i = 0; i <= strat->Ll; ++i) {
     9699    if (strat->L[i].p1 != NULL && strat->L[i].p2 != NULL) {
     9700      if (pLmEqual(strat->L[i].p1, p.p)) {
     9701        number d, s, t;
     9702        /* we need to check if we need to replace a strong poly or a usual spoly */
     9703        d = n_ExtGcd(pGetCoeff(strat->L[i].p1), pGetCoeff(strat->L[i].p2), &s, &t, currRing->cf);
     9704        if (nIsZero(s) || nIsZero(t)) {
     9705          j = replaceOneSPoly(p.p, strat->L[i].p2, strat, i);
     9706          strat->L[i].i_r1  = irpos; // might have changed
     9707        } else {
     9708          j = replaceOneStrongPoly(p.p, strat->L[i].p2, strat, i);
     9709          if (j == 0) {
     9710            i--;
     9711          } else {
     9712            strat->L[i].i_r1  = irpos; // might have changed
     9713          }
     9714        }
     9715        nDelete(&d);
     9716        nDelete(&s);
     9717        nDelete(&t);
     9718        continue;
     9719      }
     9720      if (pLmEqual(strat->L[i].p2, p.p)) {
     9721        number d, s, t;
     9722        /* we need to check if we need to replace a strong poly or a usual spoly */
     9723        d = n_ExtGcd(pGetCoeff(strat->L[i].p1), pGetCoeff(strat->L[i].p2), &s, &t, currRing->cf);
     9724
     9725        if (nIsZero(s) || nIsZero(t)) {
     9726          j = replaceOneSPoly(strat->L[i].p1, p.p, strat, i);
     9727          strat->L[i].i_r2  = irpos; // might have changed
     9728        } else {
     9729          j = replaceOneStrongPoly(strat->L[i].p1, p.p, strat, i);
     9730          if (j == 0) {
     9731            i--;
     9732          } else {
     9733            strat->L[i].i_r2  = irpos; // might have changed
     9734          }
     9735        }
     9736        nDelete(&d);
     9737        nDelete(&s);
     9738        nDelete(&t);
     9739      }
     9740    }
     9741  }
     9742
     9743  strat->enterS(p, posS, strat, irpos);
     9744  strat->T[pos].Delete();
     9745  strat->T[pos] = (TObject) p;
     9746  strat->T[pos].i_r = irpos;
     9747
     9748  if (pNext(p.p) != NULL)
     9749    strat->T[pos].max_exp = p_GetMaxExpP(pNext(p.p), strat->tailRing);
     9750  else
     9751    strat->T[pos].max_exp = NULL;
     9752
     9753  strat->R[irpos] = &(strat->T[pos]);
     9754  assume(p.sev == 0 || pGetShortExpVector(p.p) == p.sev);
     9755  strat->sevT[pos] = (p.sev == 0 ? pGetShortExpVector(p.p) : p.sev);
     9756}
     9757
    96589758void enterT(LObject &p, kStrategy strat, int atT)
    96599759{
Note: See TracChangeset for help on using the changeset viewer.