Changeset 391323 in git for kernel/kstd2.cc


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


git-svn-id: file:///usr/local/Singular/svn/trunk@9453 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.