Changeset 45cfb82 in git


Ignore:
Timestamp:
May 5, 2021, 3:23:13 PM (3 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
b385d0e618e758a8143fee011320a6c069221b2c
Parents:
502859fe5faa956d714f45c2e56bd4bd4736e1ad
Message:
opt: canonicalize buckets
Location:
kernel/GBEngine
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kLiftstd.cc

    r502859 r45cfb82  
    132132    }
    133133    p_Delete(&M[i],tailR);
     134    if ((i+1)%RED_CANONICALIZE==0) kBucketCanonicalize(b);
    134135  }
    135136  poly p;
     
    296297    pass++;
    297298    d = h_d + h->ecart;
    298     if (pass%64==0) kBucketCanonicalize(h->bucket);
    299   }
    300 }
     299    if (pass%RED_CANONICALIZE==0) kBucketCanonicalize(h->bucket);
     300  }
     301}
  • kernel/GBEngine/kstd1.cc

    r502859 r45cfb82  
    792792  long reddeg,d;
    793793  int pass = 0;
     794  int cnt = 0;
    794795  int j = 0;
    795796
     
    907908        d = h->SetDegStuffReturnLDeg(strat->LDegLast);
    908909      /*- try to reduce the s-polynomial -*/
     910      cnt++;
    909911      pass++;
    910912      /*
     
    933935        }
    934936      }
    935       if (UNLIKELY(pass>30))
     937      if (UNLIKELY(cnt>RED_CANONICALIZE))
    936938      {
    937939        h->CanonicalizeP();
    938         pass=0;
    939         if (TEST_OPT_PROT) { PrintS("!");mflush(); }
     940        cnt=0;
     941        //if (TEST_OPT_PROT) { PrintS("!");mflush(); }
    940942      }
    941943      if ((TEST_OPT_PROT) && (strat->Ll < 0) && (d >= reddeg))
  • kernel/GBEngine/kstd2.cc

    r502859 r45cfb82  
    934934
    935935  poly h_p;
    936   int i,j,at,pass, ii;
     936  int i,j,at,pass,cnt,ii;
    937937  unsigned long not_sev;
    938938  // long reddeg,d;
    939939
    940   pass = j = 0;
     940  cnt = pass = j = 0;
    941941  // d = reddeg = h->GetpFDeg();
    942942  h->SetShortExpVector();
     
    10681068     *-if the number of pre-defined reductions jumps
    10691069     */
     1070    cnt++;
    10701071    pass++;
    10711072    if (!TEST_OPT_REDTHROUGH && (strat->Ll >= 0) && (pass > strat->LazyPass))
     
    10971098      }
    10981099    }
    1099     else if (UNLIKELY(pass>30))
     1100    else if (UNLIKELY(cnt>RED_CANONICALIZE))
    11001101    {
    11011102      h->CanonicalizeP();
    1102       pass=0;
    1103       if (TEST_OPT_PROT) { PrintS("!");mflush(); }
     1103      cnt=0;
     1104      //if (TEST_OPT_PROT) { PrintS("!");mflush(); }
    11041105    }
    11051106  }
     
    15621563poly redtailSba (LObject* L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
    15631564{
    1564 #define REDTAIL_CANONICALIZE 100
    15651565  strat->redTailChange=FALSE;
    15661566  if (strat->noTailReduction) return L->GetLmCurrRing();
     
    16871687  int j = 0;
    16881688  int pass = 0;
     1689  int cnt = 0;
    16891690  assume(h->pFDeg() == h->FDeg);
    16901691  long reddeg = h->GetpFDeg();
     
    18181819    d = h->SetpFDeg();
    18191820    /*- try to reduce the s-polynomial -*/
     1821    cnt++;
    18201822    pass++;
    18211823    if (//!TEST_OPT_REDTHROUGH &&
     
    18701872      }
    18711873    }
    1872     else if (UNLIKELY(pass>30))
     1874    else if (UNLIKELY(cnt>RED_CANONICALIZE))
    18731875    {
    18741876      h->CanonicalizeP();
    1875       pass=0;
    1876       if (TEST_OPT_PROT) { PrintS("!");mflush(); }
     1877      cnt=0;
     1878      //if (TEST_OPT_PROT) { PrintS("!");mflush(); }
    18771879    }
    18781880  }
     
    21182120poly redNF (poly h,int &max_ind,int nonorm,kStrategy strat)
    21192121{
    2120 #define REDNF_CANONICALIZE 60
    21212122  if (h==NULL) return NULL;
    21222123  int j;
     
    22172218      {
    22182219        kBucketDestroy(&P.bucket);
    2219 
    2220 #ifdef KDEBUG
    2221 //        if (TEST_OPT_DEBUG)
    2222 //        {
    2223 //          PrintS("redNF: starting S:\n");
    2224 //          for( j = 0; j <= max_ind; j++ )
    2225 //          {
    2226 //            Print("S[%d] (of size: %d): ", j, pSize(strat->S[j]));
    2227 //            pWrite(strat->S[j]);
    2228 //          }
    2229 //        };
    2230 #endif
    2231 
    22322220        return NULL;
    22332221      }
     
    22502238      kBucketDestroy(&P.bucket);
    22512239      pNormalize(P.p);
    2252 
    2253 #ifdef KDEBUG
    2254 //      if (TEST_OPT_DEBUG)
    2255 //      {
    2256 //        PrintS("redNF: starting S:\n");
    2257 //        for( j = 0; j <= max_ind; j++ )
    2258 //        {
    2259 //          Print("S[%d] (of size: %d): ", j, pSize(strat->S[j]));
    2260 //          pWrite(strat->S[j]);
    2261 //        }
    2262 //      };
    2263 #endif
    2264 
    22652240      return P.p;
    22662241    }
     
    22902265#ifdef HAVE_RINGS
    22912266  BOOLEAN is_ring = rField_is_Ring(currRing);
    2292 #endif
    2293 #ifdef KDEBUG
    2294 //  if (TEST_OPT_DEBUG)
    2295 //  {
    2296 //    PrintS("redNF: starting S:\n");
    2297 //    for( j = 0; j <= max_ind; j++ )
    2298 //    {
    2299 //      Print("S[%d] (of size: %d): ", j, pSize(strat->S[j]));
    2300 //      pWrite(strat->S[j]);
    2301 //    }
    2302 //  };
    23032267#endif
    23042268
     
    23752339      {
    23762340        kBucketDestroy(&P.bucket);
    2377 
    2378 #ifdef KDEBUG
    2379 //        if (TEST_OPT_DEBUG)
    2380 //        {
    2381 //          PrintS("redNF: starting S:\n");
    2382 //          for( j = 0; j <= max_ind; j++ )
    2383 //          {
    2384 //            Print("S[%d] (of size: %d): ", j, pSize(strat->S[j]));
    2385 //            pWrite(strat->S[j]);
    2386 //          }
    2387 //        };
    2388 #endif
    2389 
    23902341        return NULL;
    23912342      }
     
    24082359      kBucketDestroy(&P.bucket);
    24092360      pNormalize(P.p);
    2410 
    2411 #ifdef KDEBUG
    2412 //      if (TEST_OPT_DEBUG)
    2413 //      {
    2414 //        PrintS("redNF: starting S:\n");
    2415 //        for( j = 0; j <= max_ind; j++ )
    2416 //        {
    2417 //          Print("S[%d] (of size: %d): ", j, pSize(strat->S[j]));
    2418 //          pWrite(strat->S[j]);
    2419 //        }
    2420 //      };
    2421 #endif
    2422 
    24232361      return P.p;
    24242362    }
  • kernel/GBEngine/kutil.cc

    r502859 r45cfb82  
    71457145poly redtailBba (LObject* L, int end_pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
    71467146{
    7147 #define REDTAIL_CANONICALIZE 100
    71487147  strat->redTailChange=FALSE;
    71497148  if (strat->noTailReduction) return L->GetLmCurrRing();
  • kernel/GBEngine/kutil.h

    r502859 r45cfb82  
    3333#define setmaxT ((4096-12)/sizeof(TObject))
    3434#define setmaxTinc ((4096)/sizeof(TObject))
     35
     36#define RED_CANONICALIZE 50
     37#define REDNF_CANONICALIZE 60
     38#define REDTAIL_CANONICALIZE 100
    3539
    3640// if you want std computations as in Singular version < 2:
Note: See TracChangeset for help on using the changeset viewer.