Changeset c0632a4 in git


Ignore:
Timestamp:
Jul 5, 2018, 9:02:32 PM (5 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
3a961a3f6d0a9dd9edd07a18ca373384df3a221c
Parents:
216e128447d274610a03d71c71d03d4e7d330814
Message:
the tail of shifted polys in T is now the tail of the unshifted poly
Location:
kernel/GBEngine
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kspoly.cc

    r216e12 rc0632a4  
    9696#endif
    9797
    98   if (tailRing->isLPring && t2 == NULL && PW->pUnshifted != NULL) {
    99       t2 = pNext(PW->pUnshifted);
    100   }
    101 
    10298  if (t2==NULL)           // Divisor is just one term, therefore it will
    10399  {                       // just cancel the leading term
     
    108104
    109105  p_ExpVectorSub(lm, p2, tailRing); // Calculate the Monomial we must multiply to p2
    110 
    111   poly lmRight;
    112   if (tailRing->isLPring) {
    113     k_SplitFrame(lm, lmRight, PW->shift + 1, tailRing);
    114   } // the while loop below won't be executed for letterplace
    115106
    116107  //if (tailRing != currRing)
     
    133124  }
    134125
     126  poly lmRight;
     127  if (tailRing->isLPring) {
     128    k_SplitFrame(lm, lmRight, PW->shift + 1, tailRing);
     129  }
     130
    135131  // take care of coef buisness
    136132  if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
     
    227223#endif
    228224
    229   if (tailRing->isLPring && t2 == NULL && PW->pUnshifted != NULL) {
    230       t2 = pNext(PW->pUnshifted);
    231   }
    232 
    233225  if (t2==NULL)           // Divisor is just one term, therefore it will
    234226  {                       // just cancel the leading term
     
    239231
    240232  p_ExpVectorSub(lm, p2, tailRing); // Calculate the Monomial we must multiply to p2
    241 
    242   poly lmRight;
    243   if (tailRing->isLPring) {
    244     k_SplitFrame(lm, lmRight, PW->shift + 1, tailRing);
    245   } // the while loop below won't be executed for letterplace
    246233
    247234  if (tailRing != currRing)
     
    262249      ret = 1;
    263250    }
     251  }
     252
     253  poly lmRight;
     254  if (tailRing->isLPring) {
     255    k_SplitFrame(lm, lmRight, PW->shift + 1, tailRing);
    264256  }
    265257
     
    432424#endif
    433425
    434   if (tailRing->isLPring && t2 == NULL && PW->pUnshifted != NULL) {
    435       t2 = pNext(PW->pUnshifted);
    436   }
    437 
    438426  if (t2==NULL)           // Divisor is just one term, therefore it will
    439427  {                       // just cancel the leading term
     
    444432
    445433  p_ExpVectorSub(lm, p2, tailRing); // Calculate the Monomial we must multiply to p2
    446 
    447   poly lmRight;
    448   if (tailRing->isLPring) {
    449     k_SplitFrame(lm, lmRight, PW->shift + 1, tailRing);
    450   } // the while loop below won't be executed for letterplace
    451434
    452435  if (tailRing != currRing)
     
    467450      ret = 1;
    468451    }
     452  }
     453
     454  poly lmRight;
     455  if (tailRing->isLPring) {
     456    k_SplitFrame(lm, lmRight, PW->shift + 1, tailRing);
    469457  }
    470458
     
    670658#endif
    671659
    672   if (tailRing->isLPring && t2 == NULL && PW->pUnshifted != NULL) {
    673       t2 = pNext(PW->pUnshifted);
    674   }
    675 
    676660  if (t2==NULL)           // Divisor is just one term, therefore it will
    677661  {                       // just cancel the leading term
     
    682666
    683667  p_ExpVectorSub(lm, p2, tailRing); // Calculate the Monomial we must multiply to p2
    684 
    685   poly lmRight;
    686   if (tailRing->isLPring) {
    687     k_SplitFrame(lm, lmRight, PW->shift + 1, tailRing);
    688   } // the while loop below won't be executed for letterplace
    689668
    690669  if (tailRing != currRing)
     
    705684      ret = 1;
    706685    }
     686  }
     687
     688  poly lmRight;
     689  if (tailRing->isLPring) {
     690    k_SplitFrame(lm, lmRight, PW->shift + 1, tailRing);
    707691  }
    708692
  • kernel/GBEngine/kutil.cc

    r216e12 rc0632a4  
    566566        else
    567567        {
     568          if (currRing->isLPring && strat->T[j].shift > 0) {
     569            pNext(p) = NULL; // pNext(p) points to the unshifted tail, don't try to delete it here
     570          }
    568571          pDelete(&p);
    569572        }
     
    822825    if (T->p == NULL && i > 0)
    823826      return dReportError("%c[%d].p is NULL", TN, i);
    824     pFalseReturn(p_Test(T->p, currRing));
     827    if (currRing->isLPring && T->shift > 0) {
     828      // in this case, the order is not correct. test LM and tail separately
     829      pFalseReturn(p_LmTest(T->p, currRing));
     830      pFalseReturn(p_Test(pNext(T->p), currRing));
     831    } else {
     832      pFalseReturn(p_Test(T->p, currRing));
     833    }
    825834  }
    826835
     
    92779286  int i;
    92789287
    9279   pp_Test(p.p, currRing, p.tailRing);
     9288#ifdef PDEBUG
     9289  if (currRing->isLPring && p.shift > 0) {
     9290    // in this case, the order is not correct. test LM and tail separately
     9291    p_LmTest(p.p, currRing);
     9292    p_Test(pNext(p.p), currRing);
     9293  } else {
     9294    pp_Test(p.p, currRing, p.tailRing);
     9295  }
     9296#endif
    92809297  assume(strat->tailRing == p.tailRing);
    92819298  // redMoraNF complains about this -- but, we don't really
     
    93269343  }
    93279344
    9328   if ((strat->tailBin != NULL) && (pNext(p.p) != NULL))
     9345  // letterplace: if p.shift > 0 then pNext(p.p) is already in the tailBin
     9346  if ((strat->tailBin != NULL) && (pNext(p.p) != NULL) && !(currRing->isLPring && p.shift > 0))
    93299347  {
    93309348    pNext(p.p)=p_ShallowCopyDelete(pNext(p.p),
     
    1250112519#ifdef HAVE_SHIFTBBA
    1250212520/*2
    12503 * puts p to the set T, starting with the at position atT
    12504 * and inserts all admissible shifts of p
     12521* enteres all admissible shifts of p into T
     12522* assumes that p is already in T!
    1250512523*/
    1250612524void enterTShift(LObject p, kStrategy strat, int atT)
     
    1251412532  int toInsert = itoInsert(p.p, strat->tailRing);
    1251512533
    12516   poly shifted;
    1251712534  for (int i = 1; i <= toInsert; i++)
    1251812535  {
    12519     shifted = p_mLPshift(p_Head(p.p, currRing), i, currRing);
    12520     LObject qq(shifted);
    12521     qq.SetpFDeg();
    12522     qq.SetShortExpVector();
     12536    poly shifted = p_mLPshift(p_Head(p.p, currRing), i, currRing);
     12537    pNext(shifted) = pNext(p.p);
     12538    LObject qq;
     12539    qq.p = shifted; // don't use Set() because it'll test the poly order
    1252312540    qq.shift = i;
    12524     qq.pUnshifted = pNext(p.p);
    12525     strat->initEcart(&qq);
    12526     qq.ecart = p.ecart;
    12527     #ifdef KTEST
    12528     kTest_T(&qq, strat->tailRing, -1, 'L');
    12529     #endif
    12530     /* enter it into T, first el't is with the shift 0 */
    12531     enterT(qq, strat, atT);
     12541    strat->initEcart(&qq); // initEcartBBA sets length, pLength, FDeg and ecart
     12542
     12543    enterT(qq, strat, atT); // enterT is modified, so it doesn't copy and delete the tail of shifted polys
    1253212544  }
    1253312545}
  • kernel/GBEngine/kutil.h

    r216e12 rc0632a4  
    9696  // letterplace
    9797  int shift;
    98   poly pUnshifted;
    9998
    10099  // initialization
Note: See TracChangeset for help on using the changeset viewer.