Changeset 942846 in git


Ignore:
Timestamp:
Oct 18, 1999, 1:19:30 PM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
04033394eb7a0db6486441c5de8d4bde3f0a1da3
Parents:
60a365f1c6147d79e7b175c37ff30a7f49a5293a
Message:
* slightly changed default heaps
* prepration in k* stuff for buckets and heaps


git-svn-id: file:///usr/local/Singular/svn/trunk@3720 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • Singular/kstd1.cc

    r60a365f r942846  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd1.cc,v 1.40 1999-10-14 17:59:33 Singular Exp $ */
     4/* $Id: kstd1.cc,v 1.41 1999-10-18 11:19:26 obachman Exp $ */
    55/*
    66* ABSTRACT:
     
    121121* requires thar T is sorted by ecart
    122122*/
    123 void redEcart19 (LObject* h,kStrategy strat)
     123int redEcart19 (LObject* h,kStrategy strat)
    124124{
    125125  int i,at,reddeg,d;
     
    137137    if (j > strat->tl)
    138138    {
    139       return;
     139      return 1;
    140140    }
    141141    if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
     
    161161            (*h).p = NULL;
    162162            strat->fromT = FALSE;
    163             return;
     163            return -1;
    164164          }
    165165        }
     
    177177      {
    178178        if (h->lcm!=NULL) pFree1((*h).lcm);
    179         return;
     179        return 0;
    180180      }
    181181      h->sev = pGetShortExpVector(h->p);
     
    198198        {
    199199          if (TEST_OPT_DEBUG) PrintS(" > sysComp\n");
    200           return;
     200          return -2;
    201201        }
    202202      }
     
    219219          {
    220220            i--;
    221             if (i<0) return;
     221            if (i<0) return 1;
    222222          } while (!pShortDivisibleBy(strat->S[i], strat->sevS[i],
    223223                                      (*h).p, not_sev));
     
    225225          if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
    226226          (*h).p = NULL;
    227           return;
     227          return -1;
    228228        }
    229229      }
     
    246246* element in T with respect to the given ecart
    247247*/
    248 void redEcart (LObject* h,kStrategy strat)
     248int redEcart (LObject* h,kStrategy strat)
    249249{
    250250  poly pi;
     
    263263    if (j > strat->tl)
    264264    {
    265       return;
     265      return 1;
    266266    }
    267267    if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
     
    318318            (*h).p = NULL;
    319319            strat->fromT = FALSE;
    320             return;
     320            return -1;
    321321          }
    322322        }
     
    334334      {
    335335        if (h->lcm!=NULL) pFree1((*h).lcm);
    336         return;
     336        return 0;
    337337      }
    338338      h->sev = pGetShortExpVector(h->p);
     
    356356        {
    357357          if (TEST_OPT_DEBUG) PrintS(" > sysComp\n");
    358           return;
     358          return -2;
    359359        }
    360360      }
     
    377377          {
    378378            i--;
    379             if (i<0) return;
     379            if (i<0) return 1;
    380380          } while (!pShortDivisibleBy(strat->S[i], strat->sevS[i],
    381381                                      (*h).p, not_sev));
     
    383383          if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
    384384          (*h).p = NULL;
    385           return;
     385          return -1;
    386386        }
    387387      }
     
    404404* element in t with respect to the given pDivisibleBy
    405405*/
    406 void redFirst (LObject* h,kStrategy strat)
     406int redFirst (LObject* h,kStrategy strat)
    407407{
    408408  int at,reddeg,d,i;
     
    410410  int j = 0;
    411411
    412   if (h->p == NULL) return;
     412  if (h->p == NULL) return 0;
    413413  if (TEST_OPT_CANCELUNIT) cancelunit(h);
    414414  d = pFDeg((*h).p)+(*h).ecart;
     
    422422    {
    423423      assume(h->sev == pGetShortExpVector(h->p));
    424       return;
     424      return 1;
    425425    }
    426426    if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
     
    451451        if (h->lcm!=NULL) pFree1((*h).lcm);
    452452        h->sev = 0;
    453         return;
     453        return 0;
    454454      }
    455455      h->sev = pGetShortExpVector(h->p);
     
    464464        {
    465465          if (TEST_OPT_DEBUG) PrintS(" > sysComp\n");
    466           return;
     466          return -2;
    467467        }
    468468      }
     
    485485          {
    486486            i--;
    487             if (i<0) return;
     487            if (i<0) return 1;
    488488          } while (!pShortDivisibleBy(strat->S[i],strat->sevS[i],
    489489                                      (*h).p, not_sev));
     
    492492          (*h).p = NULL;
    493493          h->sev = 0;
    494           return;
     494          return 0;
    495495        }
    496496      }
     
    513513* element in t with respect to the ecart and length
    514514*/
    515 void redMoraBest (LObject* h,kStrategy strat)
     515int redMoraBest (LObject* h,kStrategy strat)
    516516{
    517517  poly pi;
     
    530530    if (j > strat->tl)
    531531    {
    532       return;
     532      return 1;
    533533    }
    534534    if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
     
    584584            (*h).p = NULL;
    585585            strat->fromT = FALSE;
    586             return;
     586            return -1;
    587587          }
    588588        }
     
    600600      {
    601601        if (h->lcm!=NULL) pFree1((*h).lcm);
    602         return;
     602        return 0;
    603603      }
    604604      h->sev = pGetShortExpVector(h->p);
     
    621621        {
    622622          if (TEST_OPT_DEBUG) PrintS(" > sysComp\n");
    623           return;
     623          return -2;
    624624        }
    625625      }
     
    642642          {
    643643            i--;
    644             if (i<0) return;
     644            if (i<0) return 1;
    645645          } while (!pShortDivisibleBy(strat->S[i],strat->sevS[i],
    646646                                      (*h).p, not_sev));
     
    648648          if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
    649649          (*h).p = NULL;
    650           return;
     650          return -1;
    651651        }
    652652      }
     
    17401740//Print("%d reductions canceled \n",strat->cel);
    17411741  HCord=strat->HCord;
    1742   FreeSizeOf((ADDRESS)strat,skStrategy);
     1742  kFreeStrat(strat);
    17431743  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
    17441744  return r;
     
    18521852    l->m[1].data=(void *)strat->M;
    18531853  }
    1854   FreeSizeOf((ADDRESS)strat,skStrategy);
     1854  kFreeStrat(strat);
    18551855  if (reduced>2)
    18561856  {
     
    18721872  else
    18731873    p=kNF2(F,Q,p,strat,lazyReduce);
    1874   FreeSizeOf((ADDRESS)strat,skStrategy);
     1874  kFreeStrat(strat);
    18751875  return p;
    18761876}
     
    18891889  else
    18901890    res=kNF2(F,Q,p,strat,lazyReduce);
    1891   FreeSizeOf((ADDRESS)strat,skStrategy);
     1891  kFreeStrat(strat);
    18921892  return res;
    18931893}
     
    19481948//  }
    19491949  ideal shdl=strat->Shdl;
    1950   FreeSizeOf((ADDRESS)strat,skStrategy);
     1950  kFreeStrat(strat);
    19511951  return shdl;
    19521952}
  • Singular/kstd2.cc

    r60a365f r942846  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.35 1999-10-15 16:07:06 obachman Exp $ */
     4/* $Id: kstd2.cc,v 1.36 1999-10-18 11:19:27 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    4747*/
    4848#if 0
    49 static void redSyz (LObject* h,kStrategy strat)
     49static int redSyz (LObject* h,kStrategy strat)
    5050{
    5151  int j = 0,i=0,pos;
     
    196196#else
    197197
    198 static void redSyz (LObject* h,kStrategy strat)
     198static int redSyz (LObject* h,kStrategy strat)
    199199{
    200200  int j = 0,i=0,pos;
     
    280280        (*h).lcm=NULL;
    281281#endif
    282         return;
     282        return 0;
    283283      }
    284284/*- try to reduce the s-polynomial -*/
     
    296296          {
    297297            pDelete(&((*h).p));
    298             return;
     298            return 0;
    299299          }
    300300          else
     
    320320        }
    321321        enterTBba((*h),strat->tl+1,strat);
    322         return;
     322        return 1;
    323323      }
    324324      j++;
     
    333333*  and the case of a degree-ordering
    334334*/
    335 static void redHomog (LObject* h,kStrategy strat)
    336 {
    337   if (strat->tl<0)
    338   {
    339     if (TEST_OPT_INTSTRATEGY) pCleardenom(h->p);
    340     enterTBba((*h),0,strat);
    341     return;
    342   }
     335static int redHomog (LObject* h,kStrategy strat)
     336{
     337  if (strat->tl<0) return 1;
    343338#ifdef KDEBUG
    344339  if (TEST_OPT_DEBUG)
     
    363358    }
    364359
    365     if (j > strat->tl)
    366     {
    367       if (TEST_OPT_INTSTRATEGY)
    368       {
    369         pCleardenom(h->p);
    370         enterTBba((*h), strat->posInT(strat->T,strat->tl,(*h)), strat);
    371       }
    372       else
    373         enterTBba((*h),strat->tl+1,strat);
    374       return;
    375     }
     360    if (j > strat->tl) return 1;
    376361
    377362    // now we found one which is divisible
     
    391376      (*h).lcm=NULL;
    392377#endif
    393       return;
     378      return 0;
    394379    }
    395380  }
     
    401386*  and not a degree-ordering
    402387*/
    403 static void redLazy (LObject* h,kStrategy strat)
    404 {
    405   if (strat->tl<0)
    406   {
    407     enterTBba((*h),0,strat);
    408     return;
    409   }
    410 
     388static int redLazy (LObject* h,kStrategy strat)
     389{
     390  if (strat->tl<0) return 1;
    411391  int at,d,i;
    412392  int j = 0;
     
    428408    }
    429409
    430     if (j>strat->tl)
    431     {
    432       if (TEST_OPT_INTSTRATEGY)
    433       {
    434         pCleardenom(h->p);// also does a pContent
    435       }
    436       enterTBba((*h),strat->tl+1,strat);
    437       return;
    438     }
     410    if (j>strat->tl) return 1;
    439411
    440412    if (TEST_OPT_DEBUG)
     
    445417      wrp(strat->T[j].p);
    446418    }
     419
    447420    ksReducePoly(h, &(strat->T[j]), strat->kNoether);
     421
    448422    if (TEST_OPT_DEBUG)
    449423    {
     
    452426      PrintLn();
    453427    }
     428
    454429    if ((*h).p == NULL)
    455430    {
     
    458433      (*h).lcm=NULL;
    459434#endif
    460       return;
     435      return 0;
    461436    }
    462437    h->sev = pGetShortExpVector(h->p);
     
    474449        {
    475450          i--;
    476           if (i<0)
    477           {
    478             enterTBba((*h),strat->tl+1,strat);
    479             return;
    480           }
     451          if (i<0) return 1;
    481452        }
    482453        while (!pShortDivisibleBy(strat->S[i], strat->sevS[i],
     
    485456        enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    486457        (*h).p = NULL;
    487         return;
     458        return -1;
    488459      }
    489460    }
     
    501472* element in T with respect to the given ecart
    502473*/
    503 static void redHoney (LObject*  h,kStrategy strat)
    504 {
    505   if (strat->tl<0)
    506   {
    507     enterTBba((*h),0,strat);
    508     return;
    509   }
     474static int redHoney (LObject*  h,kStrategy strat)
     475{
     476  if (strat->tl<0) return 1;
    510477
    511478  poly pi;
     
    530497    {
    531498      h->sev = ~ not_sev;
    532       if (TEST_OPT_INTSTRATEGY)
    533       {
    534         pCleardenom(h->p);// also does a pContent
    535       }
    536       at=strat->posInT(strat->T,strat->tl,(*h));
    537       enterTBba((*h),at,strat);
    538       return;
     499      return 1;
    539500    }
    540501
     
    587548          if (TEST_OPT_DEBUG) Print(" ecart too big: -> L%d\n",at);
    588549          (*h).p = NULL;
    589           return;
     550          return -1;
    590551        }
    591552      }
     
    623584      (*h).lcm=NULL;
    624585#endif
    625       return;
     586      return 0;
    626587    }
    627588    h->sev = pGetShortExpVector(h->p);
     
    650611        {
    651612          i--;
    652           if (i<0)
    653           {
    654             at=strat->posInT(strat->T,strat->tl,(*h));
    655             enterTBba((*h),at,strat);
    656             return;
    657           }
     613          if (i<0) return 1;
    658614        } while (!pShortDivisibleBy(strat->S[i], strat->sevS[i],
    659615                                    h->p, not_sev));
     
    662618          Print(" degree jumped: -> L%d\n",at);
    663619        (*h).p = NULL;
    664         return;
     620        return -1;
    665621      }
    666622    }
     
    677633*  reduces with elements from T and chooses the best possible
    678634*/
    679 static void redBest (LObject*  h,kStrategy strat)
    680 {
    681   if (strat->tl<0)
    682   {
    683     enterTBba((*h),0,strat);
    684     return;
    685   }
    686 
     635static int redBest (LObject*  h,kStrategy strat)
     636{
     637  if (strat->tl<0) return 1;
    687638  int j,jbest,at,reddeg,d,pass;
    688639  poly     p,ph;
     
    724675                (*h).lcm=NULL;
    725676#endif
    726                 return;
     677                return 0;
    727678              }
    728679              else if (pComp0(ph,p) == -1)
     
    749700#endif
    750701        (*h).p = NULL;
    751         return;
     702        return 0;
    752703      }
    753704      if (strat->honey && pLexOrder)
     
    766717            enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    767718            (*h).p = NULL;
    768             return;
     719            return -1;
    769720          }
    770721        }
     
    780731    else
    781732    {
    782       if (j >= strat->tl)
    783       {
    784         if (TEST_OPT_INTSTRATEGY)
    785         {
    786           pCleardenom(h->p);// also does a pContent
    787         }
    788         at=strat->posInT(strat->T,strat->tl,(*h));
    789         enterTBba((*h),at,strat);
    790         return;
    791       }
     733      if (j >= strat->tl) return 1;
    792734      j++;
    793735    }
     
    864806    strat->red = redHomog;
    865807  if (TEST_OPT_MINRES && strat->homog && (strat->syzComp >0))
     808  {
    866809    strat->red = redSyz;
     810    strat->posInT = posInT0;
     811  }
    867812
    868813  if (pLexOrder && strat->honey)
     
    903848}
    904849
     850void kinitBbaHeaps(kStrategy heap)
     851{
     852#if 0
     853  // use extra heap for monoms of T, if not syzcomp
     854  if (!strat->red == redSyz)
     855  {
     856    strat->THeap = mmCreateTempHeap();
     857  }
     858#endif
     859}
     860
    905861
    906862ideal bba (ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat)
    907863{
    908   int   srmax,lrmax;
     864  int   srmax,lrmax, red_result;
    909865  int   olddeg,reduc;
    910866  int hilbeledeg=1,hilbcount=0,minimcnt=0;
     
    916872  /*set enterS, spSpolyShort, reduce, red, initEcart, initEcartPair*/
    917873  /*Shdl=*/initBuchMora(F, Q,strat);
    918   if (strat->minim>0)
    919   {
    920     strat->M=idInit(IDELEMS(F),F->rank);
    921   }
     874  if (strat->minim>0) strat->M=idInit(IDELEMS(F),F->rank);
     875  kinitBbaHeaps(strat);
    922876  srmax = strat->sl;
    923877  reduc = olddeg = lrmax = 0;
     
    927881    if (strat->Ll > lrmax) lrmax =strat->Ll;/*stat.*/
    928882    if (TEST_OPT_DEBUG) messageSets(strat);
    929     //test_int_std(strat->kIdeal);
    930883    if (strat->Ll== 0) strat->interpt=TRUE;
    931884    if (TEST_OPT_DEGBOUND
     
    944897    strat->P = strat->L[strat->Ll];
    945898    strat->Ll--;
    946     kTest_TS(strat);
     899
    947900    if (pNext(strat->P.p) == strat->tail)
    948901    {
     
    953906                    strat->kNoether);
    954907    }
    955     if((strat->P.p1==NULL) && (strat->minim>0))
    956       strat->P.p2=pCopy(strat->P.p);
    957     if (strat->honey)
    958     {
    959       if (TEST_OPT_PROT) message(strat->P.ecart+pFDeg(strat->P.p),&olddeg,&reduc,strat);
    960     }
    961     else
    962     {
    963       if (TEST_OPT_PROT) message(pFDeg(strat->P.p),&olddeg,&reduc,strat);
    964     }
     908    if((strat->P.p1==NULL) && (strat->minim>0)) strat->P.p2=pCopy(strat->P.p);
     909
     910    if (TEST_OPT_PROT)
     911      message((strat->honey ? strat->P.ecart : 0) + pFDeg(strat->P.p),
     912              &olddeg,&reduc,strat);
     913
    965914    /* reduction of the element choosen from L */
    966     strat->red(&strat->P,strat);
    967     if (strat->P.p != NULL)
     915    red_result = strat->red(&strat->P,strat);
     916
     917    // reduktion to non-zero new poly
     918    if (red_result == 1)
    968919    {
    969920      /* statistic */
     
    972923      {
    973924        int pos=posInS(strat->S,strat->sl,strat->P.p);
    974         {
    975           if (TEST_OPT_INTSTRATEGY)
     925        if (TEST_OPT_INTSTRATEGY)
     926        {
     927          pCleardenom(strat->P.p);
     928          if ((!TEST_OPT_MINRES)||(strat->syzComp==0)||(!strat->homog))
    976929          {
    977             if ((!TEST_OPT_MINRES)||(strat->syzComp==0)||(!strat->homog))
    978             {
    979               strat->P.p = redtailBba(strat->P.p,pos-1,strat);
    980               // if (strat->redTailChange)
    981               pCleardenom(strat->P.p);
    982             }
     930            strat->P.p = redtailBba(strat->P.p,pos-1,strat);
     931            pCleardenom(strat->P.p);
     932          }
     933        }
     934        else
     935        {
     936          pNorm(strat->P.p);
     937          if ((!TEST_OPT_MINRES)||(strat->syzComp==0)||(!strat->homog))
     938          {
     939            strat->P.p = redtailBba(strat->P.p,pos-1,strat);
     940          }
     941        }
     942
     943        if (TEST_OPT_DEBUG){PrintS("new s:");wrp(strat->P.p);PrintLn();}
     944
     945        if ((strat->P.p1==NULL) && (strat->minim>0))
     946        {
     947          if (strat->minim==1)
     948          {
     949            strat->M->m[minimcnt]=pCopy(strat->P.p);
     950            pDelete(&strat->P.p2);
    983951          }
    984952          else
    985953          {
    986             pNorm(strat->P.p);
    987             if ((!TEST_OPT_MINRES)||(strat->syzComp==0)||(!strat->homog))
    988             {
    989               strat->P.p = redtailBba(strat->P.p,pos-1,strat);
    990             }
     954            strat->M->m[minimcnt]=strat->P.p2;
     955            strat->P.p2=NULL;
    991956          }
    992           if (TEST_OPT_DEBUG)
    993           {
    994             PrintS("new s:");
    995             wrp(strat->P.p);
    996             PrintLn();
    997           }
    998           if((strat->P.p1==NULL) && (strat->minim>0))
    999           {
    1000             if (strat->minim==1)
    1001             {
    1002               strat->M->m[minimcnt]=pCopy(strat->P.p);
    1003               pDelete(&strat->P.p2);
    1004             }
    1005             else
    1006             {
    1007               strat->M->m[minimcnt]=strat->P.p2;
    1008               strat->P.p2=NULL;
    1009             }
    1010             minimcnt++;
    1011           }
    1012           enterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat);
    1013           if (strat->sl==-1) pos=0;
    1014           else pos=posInS(strat->S,strat->sl,strat->P.p);
    1015           strat->enterS(strat->P,pos,strat);
    1016         }
     957          minimcnt++;
     958        }
     959
     960        // put stuff into T-Set
     961        enterTBba(strat->P, strat->posInT(strat->T,strat->tl,strat->P),
     962                  strat);
     963        enterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat);
     964        // do we really need to recompute posInS
     965        strat->enterS(strat->P,posInS(strat->S,strat->sl,strat->P.p), strat);
    1017966        if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
    1018967      }
     
    12221171  }
    12231172  pLexOrder = b;
    1224   FreeSizeOf((ADDRESS)strat,skStrategy);
     1173  kFreeStrat(strat);
    12251174  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
    12261175  idSkipZeroes(r);
  • Singular/kstdfac.cc

    r60a365f r942846  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstdfac.cc,v 1.25 1999-10-14 14:27:12 obachman Exp $ */
     4/* $Id: kstdfac.cc,v 1.26 1999-10-18 11:19:27 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: factorizing alg. of Buchberger
     
    861861  {
    862862    orgstrat=strat->next;
    863     FreeSizeOf((ADDRESS)strat,skStrategy);
     863    kFreeStrat(strat);
    864864    strat=orgstrat;
    865865  }
  • Singular/kutil.cc

    r60a365f r942846  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.40 1999-10-15 16:07:07 obachman Exp $ */
     4/* $Id: kutil.cc,v 1.41 1999-10-18 11:19:28 obachman Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    35903590}
    35913591
     3592void kFreeStrat(kStrategy strat)
     3593{
     3594  if (strat->THeap != NULL)
     3595  {
     3596    mmMergeHeap(mm_specHeap, strat->THeap);
     3597    mmUnGetTempHeap(&(strat->THeap));
     3598  }
     3599  FreeSizeOf(strat, skStrategy);
     3600}
     3601
    35923602rOrderType_t spGetOrderType(ring r, int modrank, int syzcomp)
    35933603{
  • Singular/kutil.h

    r60a365f r942846  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kutil.h,v 1.18 1999-10-14 14:27:14 obachman Exp $ */
     6/* $Id: kutil.h,v 1.19 1999-10-18 11:19:28 obachman Exp $ */
    77/*
    88* ABSTRACT: kernel: utils for kStd
     
    2828  memHeap heap;
    2929  unsigned long sev;
    30   sTObject() { memset((void*) this, 0, sizeof(sTObject));}
     30  sTObject() { memset((void*) this, 0, sizeof(sTObject)); heap = mm_specHeap;}
    3131  inline poly SetP(poly p_new);
    3232};
     
    5555class skStrategy
    5656{
    57   public:
    58     kStrategy next;
    59     void (*red)(LObject * L,kStrategy strat);
    60     void (*initEcart)(LObject * L);
    61     int (*posInT)(const TSet T,const int tl,const LObject &h);
    62     int (*posInL)(const LSet set, const int length,
    63                   const LObject &L,const kStrategy strat);
    64     void (*enterS)(LObject h, int pos,kStrategy strat);
    65     void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG);
    66     int (*posInLOld)(const LSet Ls,const int Ll,
    67                      const LObject &Lo,const kStrategy strat);
    68     pFDegProc pOldFDeg;
    69     ideal Shdl;
    70     ideal D; /*V(S) is in D(D)*/
    71     ideal M; /*set of minimal generators*/
    72     polyset S;
    73     intset ecartS;
    74     intset fromQ;
    75     unsigned long* sevS;
    76     TSet T;
    77     LSet L;
    78     LSet    B;
    79     poly    kHEdge;
    80     poly    kNoether;
    81     BOOLEAN * NotUsedAxis;
    82     LObject P;
    83     poly tail;
    84     leftv kIdeal;
    85     intvec * kModW;
    86     intvec * kHomW;
    87     BOOLEAN *pairtest;/*used for enterOnePair*/
    88     int cp,c3;
    89     int sl,mu;
    90     int tl,tmax;
    91     int Ll,Lmax;
    92     int Bl,Bmax;
    93     int ak,LazyDegree,LazyPass;
    94     int syzComp;
    95     int HCord;
    96     int lastAxis;
    97     int newIdeal;
    98     int minim;
    99     BOOLEAN interpt;
    100     BOOLEAN homog;
    101     BOOLEAN kHEdgeFound;
    102     BOOLEAN honey,sugarCrit;
    103     BOOLEAN Gebauer,noTailReduction;
    104     BOOLEAN fromT;
    105     BOOLEAN noetherSet;
    106     BOOLEAN update;
    107     BOOLEAN posInLOldFlag;
    108            /*FALSE, if posInL == posInL10*/
    109     char    redTailChange;
    110     char    news;
    111     char    newt;/*used for messageSets*/
     57public:
     58  kStrategy next;
     59  int (*red)(LObject * L,kStrategy strat);
     60  void (*initEcart)(LObject * L);
     61  int (*posInT)(const TSet T,const int tl,const LObject &h);
     62  int (*posInL)(const LSet set, const int length,
     63                const LObject &L,const kStrategy strat);
     64  void (*enterS)(LObject h, int pos,kStrategy strat);
     65  void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG);
     66  int (*posInLOld)(const LSet Ls,const int Ll,
     67                   const LObject &Lo,const kStrategy strat);
     68  pFDegProc pOldFDeg;
     69  ideal Shdl;
     70  ideal D; /*V(S) is in D(D)*/
     71  ideal M; /*set of minimal generators*/
     72  polyset S;
     73  intset ecartS;
     74  intset fromQ;
     75  unsigned long* sevS;
     76  TSet T;
     77  LSet L;
     78  LSet    B;
     79  poly    kHEdge;
     80  poly    kNoether;
     81  BOOLEAN * NotUsedAxis;
     82  LObject P;
     83  poly tail;
     84  leftv kIdeal;
     85  intvec * kModW;
     86  intvec * kHomW;
     87  memHeap THeap;       // if != NULL, heap for monoms of T
     88  BOOLEAN use_redheap; // if TRUE, use extra heap for reductions
     89  BOOLEAN *pairtest;/*used for enterOnePair*/
     90  int cp,c3;
     91  int sl,mu;
     92  int tl,tmax;
     93  int Ll,Lmax;
     94  int Bl,Bmax;
     95  int ak,LazyDegree,LazyPass;
     96  int syzComp;
     97  int HCord;
     98  int lastAxis;
     99  int newIdeal;
     100  int minim;
     101  BOOLEAN interpt;
     102  BOOLEAN homog;
     103  BOOLEAN kHEdgeFound;
     104  BOOLEAN honey,sugarCrit;
     105  BOOLEAN Gebauer,noTailReduction;
     106  BOOLEAN fromT;
     107  BOOLEAN noetherSet;
     108  BOOLEAN update;
     109  BOOLEAN posInLOldFlag;
     110  /*FALSE, if posInL == posInL10*/
     111  char    redTailChange;
     112  char    news;
     113  char    newt;/*used for messageSets*/
    112114};
    113115
     
    168170void updateResult(ideal r,ideal Q,kStrategy strat);
    169171void completeReduce (kStrategy strat);
     172void kFreeStrat(kStrategy strat);
    170173BOOLEAN homogTest(polyset F, int Fmax);
    171174BOOLEAN newHEdge(polyset S, int ak,kStrategy strat);
  • Singular/mmalloc.c

    r60a365f r942846  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mmalloc.c,v 1.16 1999-10-14 14:27:18 obachman Exp $ */
     4/* $Id: mmalloc.c,v 1.17 1999-10-18 11:19:29 obachman Exp $ */
    55
    66/*
     
    583583  if (ptr == NULL)
    584584  {
    585     mmGarbageCollectHeaps(3);
     585    mmGarbageCollectHeaps(4);
    586586    ptr = malloc(size);
    587587    if (ptr == NULL)
     
    609609  if (res == NULL)
    610610  {
    611     mmGarbageCollectHeaps(3);
     611    mmGarbageCollectHeaps(4);
    612612    /* Can do a realloc again: manpage reads:
    613613       "If realloc() fails the original block is left untouched -
     
    642642  if (page == NULL)
    643643  {
    644     mmGarbageCollectHeaps(3);
     644    mmGarbageCollectHeaps(4);
    645645    page = PALLOC(SIZE_OF_PAGE);
    646646    if (page == NULL)
  • Singular/mmemory.h

    r60a365f r942846  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: mmemory.h,v 1.24 1999-10-14 14:27:19 obachman Exp $ */
     6/* $Id: mmemory.h,v 1.25 1999-10-18 11:19:29 obachman Exp $ */
    77/*
    88* ABSTRACT
     
    201201 **********************************/
    202202/* creates and initializes a temporary heap */
    203 extern memHeap mmCreateTempHeap(size_t size);
     203extern memHeap mmGetTempHeap(size_t size);
    204204#ifndef HEAP_DEBUG
    205 /* UNCONDITIONALLY clears and destoys temporary heap */
    206 extern void mmDestroyTempHeap(memHeap *heap_p);
     205/* UNCONDITIONALLY clears and destroys temporary heap */
     206extern void mmUnGetTempHeap(memHeap *heap_p);
    207207#else
    208 #define mmDestroyTempHeap(h) mmDebugDestroyTempHeap(h)
    209 extern void mmDebugDestroyTempHeap(memHeap *heap);
     208#define mmUnGetTempHeap(h) mmDebugDestroyTempHeap(h)
     209extern void mmUnGetTempHeap(memHeap *heap);
    210210#endif /* HEAP_DEBUG */
    211211
     
    213213/* if strict & 1, does it even if free ptr  has not changed w.r.t. last gc */
    214214/* if strict & 2, also releases free pages */
     215/* if strict & 4, gc also of temp heaps */
    215216extern void mmGarbageCollectHeaps(int strict);
    216217extern void mmGarbageCollectHeap(memHeap heap, int strict);
  • Singular/mmheap.c

    r60a365f r942846  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mmheap.c,v 1.11 1999-10-14 14:27:19 obachman Exp $ */
     4/* $Id: mmheap.c,v 1.12 1999-10-18 11:19:30 obachman Exp $ */
    55#include <stdio.h>
    66#include "mod2.h"
     
    229229    heap->current = NULL;
    230230    heap->last_gc = NULL;
    231   }
    232   else if (! strict && heap->current == heap->last_gc)
     231    return;
     232  }
     233
     234  if (! strict && heap->current == heap->last_gc)
    233235  {
    234236    return;
  • Singular/mmisc.c

    r60a365f r942846  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mmisc.c,v 1.15 1999-10-15 16:07:09 obachman Exp $ */
     4/* $Id: mmisc.c,v 1.16 1999-10-18 11:19:30 obachman Exp $ */
    55
    66/*
     
    166166    verbose &= ~Sy_bit(V_SHOW_MEM);
    167167  }
     168 
    168169  while (s_heap != NULL)
    169170  {
     
    171172    s_heap = s_heap->next;
    172173  }
    173   if (strict)
     174  if (strict & 4)
    174175  {
    175176    s_heap = mm_TempHeaps;
     
    258259  int mm_bytesAlloc = mm_bytesValloc + mm_bytesMalloc;
    259260
     261#if 0
    260262  if ( ABS(mm_bytesAlloc - mm_printMark)>(100*1024) )
    261263  {
     
    265267    mm_printMark=mm_bytesAlloc;
    266268  }
     269#else
     270  if ( ABS(mm_bytesAlloc - mm_printMark)>(1000*1024) )
     271  {
     272    mmPrintStat();
     273    mm_printMark=mm_bytesAlloc;
     274  }
     275#endif
    267276}
    268277
  • Singular/mmtables.c

    r60a365f r942846  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mmtables.c,v 1.3 1999-10-14 14:27:21 obachman Exp $ */
     4/* $Id: mmtables.c,v 1.4 1999-10-18 11:19:30 obachman Exp $ */
    55
    66/*
     
    2323#define MAX_INDEX ((MAX_BLOCK_SIZE - 1) >> 2)
    2424#define HALF_MAX_BLOCK_SIZE (((MAX_BLOCK_SIZE) / 8)*4)
    25 
    26 const size_t mm_mcbSizesAlign8 [] = {   8,  16,  24,  32,
    27                                        40,  48,  56,  64,
    28                                        80,  96, 112, 128,
    29                                       160, 192, 224, 256,
    30                                       HALF_MAX_BLOCK_SIZE, MAX_BLOCK_SIZE};
    31 const size_t mm_mcbSizesAlign4 [] = {   8,  12,  16,  20,
    32                                        24,  28,  32,
    33                                        40,  48,  56,  64,
    34                                        80,  96, 112, 128,
    35                                       160, 192, 224, 256,
    36                                       HALF_MAX_BLOCK_SIZE, MAX_BLOCK_SIZE};
     25#define QUARTER_MAX_BLOCK_SIZE (((MAX_BLOCK_SIZE) / 16)*4)
     26#define EIGHTS_MAX_BLOCK_SIZE (((MAX_BLOCK_SIZE) / 32)*4)
     27
     28const size_t mm_mcbSizesAlign8 [] =
     29{   8,  16,  24,  32,
     30    40,  48,  56,  64,
     31    80,  96, 112, 128,
     32    160, 192, 224,
     33    QUARTER_MAX_BLOCK_SIZE,
     34    QUARTER_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE,
     35    HALF_MAX_BLOCK_SIZE,
     36    HALF_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE,
     37    HALF_MAX_BLOCK_SIZE + QUARTER_MAX_BLOCK_SIZE,
     38    HALF_MAX_BLOCK_SIZE + QUARTER_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE,
     39    MAX_BLOCK_SIZE};
     40const size_t mm_mcbSizesAlign4 [] =
     41{   8,  12,  16,  20,
     42    24,  28,  32,
     43    40,  48,  56,  64,
     44    80,  96, 112, 128,
     45    160, 192, 224,
     46    QUARTER_MAX_BLOCK_SIZE,
     47    QUARTER_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE,
     48    HALF_MAX_BLOCK_SIZE,
     49    HALF_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE,
     50    HALF_MAX_BLOCK_SIZE + QUARTER_MAX_BLOCK_SIZE,
     51    HALF_MAX_BLOCK_SIZE + QUARTER_MAX_BLOCK_SIZE + EIGHTS_MAX_BLOCK_SIZE,
     52    MAX_BLOCK_SIZE};
    3753
    3854char mm_IndiciesAlign8[MAX_INDEX + 1];
     
    317333int main()
    318334{
     335#if 0
    319336  mmInitIndexTable(mm_IndiciesAlign8, mm_mcbSizesAlign8,
    320337                   mmGetBinaryIndexAlign8);
    321338  mmInitIndexTable(mm_IndiciesAlign4, mm_mcbSizesAlign4,
    322339                   mmGetBinaryIndex);
     340#else
     341  mmInitIndexTable(mm_IndiciesAlign8, mm_mcbSizesAlign8,
     342                   NULL);
     343  mmInitIndexTable(mm_IndiciesAlign4, mm_mcbSizesAlign4,
     344                   NULL);
     345#endif
    323346
    324347  printf("#ifndef MM_TABLES_INC\n#define MM_TABLES_INC\n");
Note: See TracChangeset for help on using the changeset viewer.