Changeset a973339 in git


Ignore:
Timestamp:
Dec 12, 2013, 1:55:10 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
53beb57b7f12a428116cb0a7b7bf24460400c5fb
Parents:
f1babfbabc0fc2906b36df32051eaaf09673dc6f
Message:
chg: option IDLIFT to speed up liftstd (2 args)
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/kstd1.cc

    rf1babf ra973339  
    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
  • kernel/kstd2.cc

    rf1babf ra973339  
    13901390
    13911391      // enter into S, L, and T
    1392       //if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp))
     1392      if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp))
     1393      {
    13931394        enterT(strat->P, strat);
    13941395#ifdef HAVE_RINGS
    1395       if (rField_is_Ring(currRing))
    1396         superenterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat, strat->tl);
    1397       else
    1398 #endif
    1399         enterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat, strat->tl);
    1400       // posInS only depends on the leading term
    1401       strat->enterS(strat->P, pos, strat, strat->tl);
     1396        if (rField_is_Ring(currRing))
     1397          superenterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat, strat->tl);
     1398        else
     1399#endif
     1400          enterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat, strat->tl);
     1401        // posInS only depends on the leading term
     1402        strat->enterS(strat->P, pos, strat, strat->tl);
    14021403#if 0
    1403       int pl=pLength(strat->P.p);
    1404       if (pl==1)
    1405       {
    1406         //if (TEST_OPT_PROT)
    1407         //PrintS("<1>");
    1408       }
    1409       else if (pl==2)
    1410       {
    1411         //if (TEST_OPT_PROT)
    1412         //PrintS("<2>");
    1413       }
    1414 #endif
     1404        int pl=pLength(strat->P.p);
     1405        if (pl==1)
     1406        {
     1407          //if (TEST_OPT_PROT)
     1408          //PrintS("<1>");
     1409        }
     1410        else if (pl==2)
     1411        {
     1412          //if (TEST_OPT_PROT)
     1413          //PrintS("<2>");
     1414        }
     1415#endif
     1416      }
    14151417      if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
    14161418//      Print("[%d]",hilbeledeg);
     
    24492451      // enter into S, L, and T
    24502452      // here we need to recompute new signatures, but those are trivial ones
    2451       //if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp))
    2452       enterT(strat->P, strat);
    2453       // posInS only depends on the leading term
    2454       strat->enterS(strat->P, pos, strat, strat->tl);
     2453      if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp))
     2454      {
     2455        enterT(strat->P, strat);
     2456        // posInS only depends on the leading term
     2457        strat->enterS(strat->P, pos, strat, strat->tl);
    24552458//#if 1
    24562459#ifdef DEBUGF5
    2457       Print("ELEMENT ADDED TO GCURR DURING INTERRED: ");
    2458       pWrite(pHead(strat->S[strat->sl]));
    2459       pWrite(strat->sig[strat->sl]);
    2460 #endif
    2461       if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
     2460        Print("ELEMENT ADDED TO GCURR DURING INTERRED: ");
     2461        pWrite(pHead(strat->S[strat->sl]));
     2462        pWrite(strat->sig[strat->sl]);
     2463#endif
     2464        if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
     2465      }
    24622466      //      Print("[%d]",hilbeledeg);
    24632467      if (strat->P.lcm!=NULL)
Note: See TracChangeset for help on using the changeset viewer.