Changeset f26b42 in git for kernel/GBEngine/kstd2.cc


Ignore:
Timestamp:
Oct 6, 2016, 10:46:20 AM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
7bb1ac4627f442f9075c2c48d08a79705295f950
Parents:
4aaf5920e25e841ccd0432b72d165b4d869a69bc
Message:
fix: overflow check in std, p1: completeReduce
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kstd2.cc

    r4aaf59 rf26b42  
    22762276  {
    22772277    completeReduce(strat);
    2278 #ifdef HAVE_TAIL_RING
    22792278    if (strat->completeReduce_retry)
    22802279    {
     
    22822281      // to reduce with S (instead of T)
    22832282      // and in currRing (instead of strat->tailRing)
    2284       cleanT(strat);strat->tailRing=currRing;
    2285       int i;
    2286       for(i=strat->sl;i>=0;i--) strat->S_2_R[i]=-1;
    2287       completeReduce(strat);
    2288     }
    2289 #endif
     2283#ifdef HAVE_TAIL_RING
     2284      if(currRing->bitmask>strat->tailRing->bitmask)
     2285      {
     2286        strat->completeReduce_retry=FALSE;
     2287        cleanT(strat);strat->tailRing=currRing;
     2288        int i;
     2289        for(i=strat->sl;i>=0;i--) strat->S_2_R[i]=-1;
     2290        completeReduce(strat);
     2291      }
     2292      if (strat->completeReduce_retry)
     2293#endif
     2294        Werror("exponent bound is %ld",currRing->bitmask);
     2295    }
    22902296  }
    22912297  else if (TEST_OPT_PROT) PrintLn();
    2292   if(nCoeff_is_Ring_Z(currRing->cf))
    2293     finalReduceByMon(strat);
    2294   if(rField_is_Ring(currRing))
    2295   {
    2296     for(int i = 0;i<=strat->sl;i++)
    2297     {
    2298       if(!nGreaterZero(pGetCoeff(strat->S[i])))
    2299       {
    2300         strat->S[i] = pNeg(strat->S[i]);
     2298  if (!errorreported)
     2299  {
     2300    if(nCoeff_is_Ring_Z(currRing->cf))
     2301      finalReduceByMon(strat);
     2302    if(rField_is_Ring(currRing))
     2303    {
     2304      for(int i = 0;i<=strat->sl;i++)
     2305      {
     2306        if(!nGreaterZero(pGetCoeff(strat->S[i])))
     2307        {
     2308          strat->S[i] = pNeg(strat->S[i]);
     2309        }
    23012310      }
    23022311    }
     
    23152324  if ((TEST_OPT_PROT) || (TEST_OPT_DEBUG)) messageStat(hilbcount,strat);
    23162325  SI_RESTORE_OPT1(save);
    2317   if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
     2326  if ((Q!=NULL)&&(!errorreported)) updateResult(strat->Shdl,Q,strat);
    23182327
    23192328  idTest(strat->Shdl);
Note: See TracChangeset for help on using the changeset viewer.