Changeset e57255 in git for kernel/kstd1.cc


Ignore:
Timestamp:
Dec 16, 2013, 3:12:47 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
d186d3baff30f2e6e96b2a354ff156ec286fcb4ef24b9c65dd9d2b3d937e5841295580dedc2f7412
Parents:
27877c10cae6d5eb945d62a27d66dfdf8a5a47849e8ae12733559521215c7641624da588f2d8cdf3
Message:
Merge pull request #429 from YueRen/polymakelib

Polymakelib
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/kstd1.cc

    r9e8ae12 re57255  
    29692969
    29702970      // enter into S, L, and T
    2971       //if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp))
     2971      if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp))
     2972      {
    29722973        enterT(strat->P, strat);
    2973       // posInS only depends on the leading term
    2974       strat->enterS(strat->P, pos, strat, strat->tl);
    2975 
     2974        // posInS only depends on the leading term
     2975        strat->enterS(strat->P, pos, strat, strat->tl);
     2976
     2977        if (pos<strat->sl)
     2978        {
     2979          need_retry++;
     2980          // move all "larger" elements fromS to L
     2981          // remove them from T
     2982          int ii=pos+1;
     2983          for(;ii<=strat->sl;ii++)
     2984          {
     2985            LObject h;
     2986            memset(&h,0,sizeof(h));
     2987            h.tailRing=strat->tailRing;
     2988            h.p=strat->S[ii]; strat->S[ii]=NULL;
     2989            strat->initEcart(&h);
     2990            h.sev=strat->sevS[ii];
     2991            int jj=strat->tl;
     2992            while (jj>=0)
     2993            {
     2994              if (strat->T[jj].p==h.p)
     2995              {
     2996                strat->T[jj].p=NULL;
     2997                if (jj<strat->tl)
     2998                {
     2999                  memmove(&(strat->T[jj]),&(strat->T[jj+1]),
     3000                          (strat->tl-jj)*sizeof(strat->T[jj]));
     3001                  memmove(&(strat->sevT[jj]),&(strat->sevT[jj+1]),
     3002                          (strat->tl-jj)*sizeof(strat->sevT[jj]));
     3003                }
     3004                strat->tl--;
     3005                break;
     3006              }
     3007              jj--;
     3008            }
     3009            int lpos=strat->posInL(strat->L,strat->Ll,&h,strat);
     3010            enterL(&strat->L,&strat->Ll,&strat->Lmax,h,lpos);
     3011            #ifdef KDEBUG
     3012            if (TEST_OPT_DEBUG)
     3013            {
     3014              Print("move S[%d] -> L[%d]: ",ii,pos);
     3015              p_wrp(h.p,currRing, strat->tailRing);
     3016              PrintLn();
     3017            }
     3018            #endif
     3019          }
     3020          if (strat->fromQ!=NULL)
     3021          {
     3022            for(ii=pos+1;ii<=strat->sl;ii++) strat->fromQ[ii]=0;
     3023          }
     3024          strat->sl=pos;
     3025        }
     3026      }
     3027      else
     3028      {
     3029        // clean P
     3030      }
    29763031      if (strat->P.lcm!=NULL)
    29773032#ifdef HAVE_RINGS
     
    29803035        pLmFree(strat->P.lcm);
    29813036#endif
    2982       if (pos<strat->sl)
    2983       {
    2984         need_retry++;
    2985         // move all "larger" elements fromS to L
    2986         // remove them from T
    2987         int ii=pos+1;
    2988         for(;ii<=strat->sl;ii++)
    2989         {
    2990           LObject h;
    2991           memset(&h,0,sizeof(h));
    2992           h.tailRing=strat->tailRing;
    2993           h.p=strat->S[ii]; strat->S[ii]=NULL;
    2994           strat->initEcart(&h);
    2995           h.sev=strat->sevS[ii];
    2996           int jj=strat->tl;
    2997           while (jj>=0)
    2998           {
    2999             if (strat->T[jj].p==h.p)
    3000             {
    3001               strat->T[jj].p=NULL;
    3002               if (jj<strat->tl)
    3003               {
    3004                 memmove(&(strat->T[jj]),&(strat->T[jj+1]),
    3005                         (strat->tl-jj)*sizeof(strat->T[jj]));
    3006                 memmove(&(strat->sevT[jj]),&(strat->sevT[jj+1]),
    3007                         (strat->tl-jj)*sizeof(strat->sevT[jj]));
    3008               }
    3009               strat->tl--;
    3010               break;
    3011             }
    3012             jj--;
    3013           }
    3014           int lpos=strat->posInL(strat->L,strat->Ll,&h,strat);
    3015           enterL(&strat->L,&strat->Ll,&strat->Lmax,h,lpos);
    3016           #ifdef KDEBUG
    3017           if (TEST_OPT_DEBUG)
    3018           {
    3019             Print("move S[%d] -> L[%d]: ",ii,pos);
    3020             p_wrp(h.p,currRing, strat->tailRing);
    3021             PrintLn();
    3022           }
    3023           #endif
    3024         }
    3025         if (strat->fromQ!=NULL)
    3026         {
    3027           for(ii=pos+1;ii<=strat->sl;ii++) strat->fromQ[ii]=0;
    3028         }
    3029         strat->sl=pos;
    3030       }
    30313037    }
    30323038
Note: See TracChangeset for help on using the changeset viewer.