Changeset 4869a17 in git for Singular/kutil.cc


Ignore:
Timestamp:
Sep 6, 1999, 5:43:33 PM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
b92f93c2773a0586ff73c90f27d97471c8be45e6
Parents:
b93963af1ae4b345400e16affffc6707a9e8143b
Message:
* hannes: fixed redtail-bug (bug_16)


git-svn-id: file:///usr/local/Singular/svn/trunk@3590 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/kutil.cc

    rb93963 r4869a17  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.33 1999-04-29 16:57:16 Singular Exp $ */
     4/* $Id: kutil.cc,v 1.34 1999-09-06 15:43:33 Singular Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    23252325poly redtail (poly p, int pos, kStrategy strat)
    23262326{
    2327   poly h, hn;
    2328   int j, e, l;
    2329   int op;
    2330 
    2331   if (strat->noTailReduction)
    2332   {
    2333     return p;
    2334   }
    2335   h = p;
    2336   hn = pNext(h);
    2337   while(hn != NULL)
    2338   {
    2339     op = pFDeg(hn);
    2340     e = pLDeg(hn,&l)-op;
    2341     j = 0;
    2342     while (j <= pos)
    2343     {
    2344       if (pDivisibleBy(strat->S[j], hn)
    2345       && ((e >= strat->ecartS[j])
    2346         || strat->kHEdgeFound
    2347         || ((Kstd1_deg>0)&&(op<=Kstd1_deg)))
    2348       )
    2349       {
    2350         spSpolyTail(strat->S[j], p, h, strat->kNoether, strat->spSpolyLoop);
    2351         hn = pNext(h);
    2352         if (hn == NULL)
    2353         {
    2354           return p;
    2355         }
    2356         op = pFDeg(hn);
    2357         e = pLDeg(hn,&l)-op;
    2358         j = 0;
    2359       }
    2360       else
    2361       {
    2362         j++;
    2363       }
    2364     }
    2365     h = hn;
    2366     hn = pNext(h);
     2327
     2328  if ((!strat->noTailReduction)
     2329  && (pNext(p)!=NULL))
     2330  {
     2331    int j, e, l;
     2332    poly h = p;
     2333    poly hn = pNext(h); // !=NULL
     2334    int op = pFDeg(hn);
     2335    BOOLEAN save_HE=strat->kHEdgeFound;
     2336    strat->kHEdgeFound |= ((Kstd1_deg>0) && (op<=Kstd1_deg));
     2337    loop
     2338    {
     2339      e = pLDeg(hn,&l)-op;
     2340      j = 0;
     2341      while (j <= pos)
     2342      {
     2343        if (pDivisibleBy(strat->S[j], hn)
     2344        && ((e >= strat->ecartS[j])
     2345          || strat->kHEdgeFound)
     2346        )
     2347        {
     2348          spSpolyTail(strat->S[j], p, h, strat->kNoether, strat->spSpolyLoop);
     2349          hn = pNext(h);
     2350          if (hn == NULL) goto all_done;
     2351          op = pFDeg(hn);
     2352          if ((Kstd1_deg>0)&&(op>Kstd1_deg)) goto all_done;
     2353          e = pLDeg(hn,&l)-op;
     2354          j = 0;
     2355        }
     2356        else
     2357        {
     2358          j++;
     2359        }
     2360      } /* while (j <= pos) */
     2361      h = hn; /* better for: pIter(h); */
     2362      hn = pNext(h);
     2363      if (hn==NULL) break;
     2364      op = pFDeg(hn);
     2365      if ((Kstd1_deg>0)&&(op>Kstd1_deg)) break;
     2366    }
     2367all_done:
     2368    strat->kHEdgeFound = save_HE;
    23672369  }
    23682370  return p;
Note: See TracChangeset for help on using the changeset viewer.