Changeset 0091f5 in git


Ignore:
Timestamp:
Jan 18, 2017, 4:07:25 PM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
Children:
1082b92ca9710fddf763537ffbccb6abed6ab98e
Parents:
72e8c16151daf886c929fa07bdc27e451c807ccf
Message:
fix: finalReduceByMon: in n_IntMod(A,B,C) B should be positive
Location:
kernel/GBEngine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kstd2.cc

    r72e8c1 r0091f5  
    454454      // over ZZ: cleanup coefficients by complete reduction with monomials
    455455      postReduceByMon(h, strat);
     456      if(h->p == NULL)
     457      {
     458        if (h->lcm!=NULL) pLmDelete(h->lcm);
     459        h->Clear();
     460        return 0;
     461      }
    456462      if(nIsZero(pGetCoeff(h->p))) return 2;
    457463      j = kFindDivisibleByInT(strat, h);
     
    22982304  if (!errorreported)
    22992305  {
    2300     if(nCoeff_is_Ring_Z(currRing->cf))
     2306    if(rField_is_Ring_Z(currRing))
     2307    {
     2308      for(int i = 0;i<=strat->sl;i++)
     2309      {
     2310        if(!nGreaterZero(pGetCoeff(strat->S[i])))
     2311        {
     2312          strat->S[i] = pNeg(strat->S[i]);
     2313        }
     2314      }
    23012315      finalReduceByMon(strat);
    2302     if(rField_is_Ring(currRing))
    2303     {
    23042316      for(int i = 0;i<=strat->sl;i++)
    23052317      {
     
    23102322      }
    23112323    }
     2324    else if (rField_is_Ring(currRing))
     2325      finalReduceByMon(strat);
    23122326  }
    23132327  /* release temp data-------------------------------- */
  • kernel/GBEngine/kutil.cc

    r72e8c1 r0091f5  
    14311431      {
    14321432        pLmDelete(h.lcm);
    1433         h.lcm=NULL;
     1433        h.lcm=NULL;
    14341434      }
    14351435      h.Clear();
     
    1107111071        }
    1107211072      }
    11073       pp = pNext(p);
    11074       while(pp != NULL)
    11075       {
    11076         if(pLmDivisibleBy(strat->S[i], pp))
    11077         {
    11078           number dummy = n_IntMod(pp->coef, strat->S[i]->coef, currRing->cf);
    11079           p_SetCoeff(pp,dummy,currRing);
    11080           if(nIsZero(pp->coef))
     11073      if (p!=NULL)
     11074      {
     11075        pp = pNext(p);
     11076        while(pp != NULL)
     11077        {
     11078          if(pLmDivisibleBy(strat->S[i], pp))
    1108111079          {
    11082             pLmDelete(&pNext(p));
    11083             pp = pNext(p);
    11084             deleted = TRUE;
     11080            number dummy = n_IntMod(pp->coef, strat->S[i]->coef, currRing->cf);
     11081            p_SetCoeff(pp,dummy,currRing);
     11082            if(nIsZero(pp->coef))
     11083            {
     11084              pLmDelete(&pNext(p));
     11085              pp = pNext(p);
     11086              deleted = TRUE;
     11087            }
     11088            else
     11089            {
     11090              p = pp;
     11091              pp = pNext(p);
     11092            }
    1108511093          }
    1108611094          else
     
    1109011098          }
    1109111099        }
    11092         else
    11093         {
    11094           p = pp;
    11095           pp = pNext(p);
    11096         }
    1109711100      }
    1109811101    }
    1109911102  }
    1110011103  h->SetLmCurrRing();
    11101   if(deleted)
     11104  if((deleted)&&(h->p!=NULL))
    1110211105    strat->initEcart(h);
    1110311106}
Note: See TracChangeset for help on using the changeset viewer.