Changeset 6c4143 in git


Ignore:
Timestamp:
Oct 18, 2018, 12:58:43 PM (6 years ago)
Author:
Christian Eder
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
ab6ae3e4daabcf18b48dab4c572a7e169b83bbd1
Parents:
b2bceb6030806c7016ffc929e51bb5db6615e546
Message:
adds special handling of one-term-reductions over Z
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kspoly.cc

    rb2bceb6 r6c4143  
    9595#endif
    9696
    97   /* if (t2==NULL)           // Divisor is just one term, therefore it will
    98    * {                       // just cancel the leading term
    99    *   PR->LmDeleteAndIter();
    100    *   if (coef != NULL) *coef = n_Init(1, tailRing->cf);
    101    *   return 0;
    102    * } */
     97  if (t2==NULL)           // Divisor is just one term, therefore it will
     98  {                       // just cancel the leading term
     99    // adjust lead coefficient if needed
     100    if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
     101    {
     102      number bn = pGetCoeff(lm);
     103      number an = pGetCoeff(p2);
     104      int ct = ksCheckCoeff(&an, &bn, tailRing->cf);    // Calculate special LC
     105      p_SetCoeff(lm, bn, tailRing);
     106      if ((ct == 0) || (ct == 2))
     107      PR->Tail_Mult_nn(an);
     108      if (coef != NULL) *coef = an;
     109      else n_Delete(&an, tailRing->cf);
     110    }
     111    PR->LmDeleteAndIter();
     112    if (coef != NULL) *coef = n_Init(1, tailRing->cf);
     113    return 0;
     114  }
    103115
    104116  p_ExpVectorSub(lm, p2, tailRing); // Calculate the Monomial we must multiply to p2
Note: See TracChangeset for help on using the changeset viewer.