Changeset 391323 in git


Ignore:
Timestamp:
Oct 12, 2006, 10:55:42 AM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
200e7290fa530efe0851712fa9c959236d73cb35
Parents:
8fc1b4d51d3b74816a22e5b09d2875ca81a5c44d
Message:
*hannes: NF/redNF optimized


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

Legend:

Unmodified
Added
Removed
  • kernel/kstd1.cc

    r8fc1b4d r391323  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd1.cc,v 1.12 2006-10-05 18:26:09 Singular Exp $ */
     4/* $Id: kstd1.cc,v 1.13 2006-10-12 08:55:39 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    295295      if (at <= strat->Ll)
    296296      {
    297         if (kFindDivisibleByInS(strat, h) < 0)
     297        int dummy=strat->sl;
     298        if (kFindDivisibleByInS(strat, &dummy, h) < 0)
    298299        {
    299300          if (strat->honey && !strat->posInLDependsOnLength)
     
    416417        if (at <= strat->Ll)
    417418        {
    418           if (kFindDivisibleByInS(strat, h) < 0)
     419          int dummy=strat->sl;
     420          if (kFindDivisibleByInS(strat,&dummy, h) < 0)
    419421            return 1;
    420422          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
  • kernel/kstd2.cc

    r8fc1b4d r391323  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.21 2006-10-05 18:26:10 Singular Exp $ */
     4/* $Id: kstd2.cc,v 1.22 2006-10-12 08:55:40 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    8181
    8282// same as above, only with set S
    83 int kFindDivisibleByInS(const kStrategy strat, LObject* L)
     83int kFindDivisibleByInS(const kStrategy strat, int* max_ind, LObject* L)
    8484{
    8585  unsigned long not_sev = ~L->sev;
     
    8888
    8989  pAssume(~not_sev == p_GetShortExpVector(p, currRing));
    90   int ende=posInS(strat,strat->sl,p,0)+1;
    91   if (ende>strat->sl) ende=strat->sl;
     90  int ende=strat->sl;
     91  if ((*max_ind)<ende) ende=posInS(strat,*max_ind,p,0)+1;
     92  if (ende>(*max_ind)) ende=(*max_ind);
     93  (*max_ind)=ende;
    9294  loop
    9395  {
     
    708710      if (at <= strat->Ll)
    709711      {
    710         if (kFindDivisibleByInS(strat, h) < 0)
     712        int dummy=strat->sl;
     713        if (kFindDivisibleByInS(strat, &dummy, h) < 0)
    711714          return 1;
    712715        enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     
    730733*/
    731734
    732 poly redNF (poly h,kStrategy strat)
     735poly redNF (poly h,int &max_ind,kStrategy strat)
    733736{
    734737  if (h==NULL) return NULL;
    735738  int j;
     739  max_ind=strat->sl;
    736740
    737741  if (0 > strat->sl)
     
    755759#endif
    756760*/
    757       j=kFindDivisibleByInS(strat,&P);
     761      j=kFindDivisibleByInS(strat,&max_ind,&P);
    758762    if (j>=0)
    759763    {
     
    10621066  kTest(strat);
    10631067  if (TEST_OPT_PROT) { PrintS("r"); mflush(); }
    1064   p = redNF(pCopy(q),strat);
     1068  int max_ind;
     1069  p = redNF(pCopy(q),max_ind,strat);
    10651070  if ((p!=NULL)&&(lazyReduce==0))
    10661071  {
    10671072    if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
    1068     p = redtailBba(p,strat->sl,strat);
     1073    p = redtailBba(p,max_ind,strat);
    10691074  }
    10701075  /*- release temp data------------------------------- -*/
     
    10891094  int   i;
    10901095  ideal res;
     1096  int max_ind;
    10911097
    10921098  if (idIs0(q))
     
    11171123    {
    11181124      if (TEST_OPT_PROT) { PrintS("r");mflush(); }
    1119       p = redNF(pCopy(q->m[i]),strat);
     1125      p = redNF(pCopy(q->m[i]),max_ind,strat);
    11201126      if ((p!=NULL)&&(lazyReduce==0))
    11211127      {
    11221128        if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
    1123         p = redtailBba(p,strat->sl,strat);
     1129        p = redtailBba(p,max_ind,strat);
    11241130      }
    11251131      res->m[i]=p;
  • kernel/kutil.cc

    r8fc1b4d r391323  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.31 2006-10-05 10:30:03 Singular Exp $ */
     4/* $Id: kutil.cc,v 1.32 2006-10-12 08:55:40 Singular Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    12231223  if (strat->sugarCrit)
    12241224  {
    1225     if(
    1226     (!((strat->ecartS[i]>0)&&(ecart>0)))
     1225    if((!((strat->ecartS[i]>0)&&(ecart>0)))
    12271226    && pHasNotCF(p,strat->S[i]))
    12281227    {
     
    14601459  {
    14611460    //PrintS("prod-crit\n");
    1462       if (!rIsPluralRing(currRing))
    1463       {
    1464         strat->cp++;
    1465         return;
    1466       }
     1461    if (!rIsPluralRing(currRing))
     1462    {
     1463      strat->cp++;
     1464      return;
     1465    }
    14671466  }
    14681467
     
    26512650*             otherwise, bba has to be changed
    26522651*/
    2653 int posInS (kStrategy strat, int length,poly p, int ecart_p)
     2652int posInS (const kStrategy strat, const int length,const poly p,
     2653            const int ecart_p)
    26542654{
    26552655  if(length==-1) return 0;
  • kernel/kutil.h

    r8fc1b4d r391323  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kutil.h,v 1.19 2006-10-05 18:26:10 Singular Exp $ */
     6/* $Id: kutil.h,v 1.20 2006-10-12 08:55:41 Singular Exp $ */
    77/*
    88* ABSTRACT: kernel: utils for kStd
     
    354354void initEcartPairBba (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
    355355void initEcartPairMora (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
    356 int posInS (kStrategy strat,int length,poly p, int ecart_p);
     356int posInS (const kStrategy strat, const int length, const poly p,
     357            const int ecart_p);
    357358int posInT0 (const TSet set,const int length,LObject &p);
    358359int posInT1 (const TSet set,const int length,LObject &p);
     
    391392poly redtail (poly p,int pos,kStrategy strat);
    392393poly redtail (LObject *L,int pos,kStrategy strat);
    393 poly redNF (poly h,kStrategy strat);
     394poly redNF (poly h,int & max_ind,kStrategy strat);
    394395int redNF0 (LObject *P,kStrategy strat);
    395396poly redNFTail (poly h,const int sl,kStrategy strat);
     
    444445                        const int tl, const LObject* L, const int start=0);
    445446// same with S
    446 int kFindDivisibleByInS(const kStrategy strat, LObject* L);
     447int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject* L);
    447448
    448449TObject*
  • kernel/tgb.cc

    r8fc1b4d r391323  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb.cc,v 1.101 2006-10-05 18:26:10 Singular Exp $ */
     7/* $Id: tgb.cc,v 1.102 2006-10-12 08:55:42 Singular Exp $ */
    88/*
    99* ABSTRACT: slimgb and F4 implementation
     
    767767  int i=0;
    768768  LObject P;
    769   while(i<=strat->sl){
     769  while(i<=strat->sl)
     770  {
    770771    P.p=strat->S[i];
    771772    P.sev=strat->sevS[i];
    772     if(kFindDivisibleByInS(strat,&P)!=i)
     773    int dummy=strat->sl;
     774    if(kFindDivisibleByInS(strat,&dummy,&P)!=i)
    773775    {
    774776      deleteInS(i,strat);
     
    777779      int j;
    778780      for(j=0;j<c->n;j++)
    779   if(c->S->m[j]==P.p)
    780   {
    781     found=TRUE;
    782     break;
    783   }
     781      {
     782        if(c->S->m[j]==P.p)
     783        {
     784          found=TRUE;
     785          break;
     786        }
     787      }
    784788      if (!found)
    785789  pDelete(&P.p);
     
    15461550  //int max_pos=simple_posInS(strat,P.p);
    15471551  loop
    1548     {
    1549       j=kFindDivisibleByInS(strat,&P);
     1552  {
     1553      int dummy=strat->sl;
     1554      j=kFindDivisibleByInS(strat,&dummy,&P);
    15501555      if ((j>=0) && ((!n)||
    15511556        ((strat->lenS[j]<=n) &&
     
    20262031      loop
    20272032      {
    2028           j=kFindDivisibleByInS(strat,&P);
     2033          int dummy=strat->sl;
     2034          j=kFindDivisibleByInS(strat,&dummy,&P);
    20292035          if (j>=0)
    20302036          {
Note: See TracChangeset for help on using the changeset viewer.