Changeset d14712 in git for Singular/kstd1.cc


Ignore:
Timestamp:
Sep 29, 1999, 12:59:43 PM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
4f011a3b4ee2de9e079fb1b3ff36483e9f1f0511
Parents:
c88c949ab8d0ed79f5fe01cd33e526815d5e041f
Message:
* got rid off STDTRACE, FAST_AND_DIRTY, (most) DRING, SRING, SDRING
* got rid of spoly*.* stuff


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

Legend:

Unmodified
Added
Removed
  • Singular/kstd1.cc

    rc88c949 rd14712  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd1.cc,v 1.37 1999-09-13 08:16:20 Singular Exp $ */
     4/* $Id: kstd1.cc,v 1.38 1999-09-29 10:59:30 obachman Exp $ */
    55/*
    66* ABSTRACT:
     
    1414#include "kutil.h"
    1515#include "kstd1.h"
    16 #include "kstd2.h"
    1716#include "khstd.h"
    18 #include "spolys.h"
    1917#include "stairc.h"
    2018#include "weight.h"
     
    2624#include "timer.h"
    2725#include "lists.h"
    28 #ifdef STDTRACE
    29 #include "comm.h"
    30 #endif
    31 #include "spSpolyLoop.h"
    3226
    3327//#include "ipprint.h"
     
    108102  if (intoT)
    109103  {
    110     hp = spSpolyRedNew(*with,(*h).p,strat->kNoether, strat->spSpolyLoop);
     104    hp = ksOldSpolyRedNew(*with,(*h).p,strat->kNoether);
    111105    enterT(*h,strat);
    112106    (*h).p = hp;
     
    114108  else
    115109  {
    116     (*h).p = spSpolyRed(*with,(*h).p,strat->kNoether, strat->spSpolyLoop);
     110    (*h).p = ksOldSpolyRed(*with,(*h).p,strat->kNoether);
    117111  }
    118112  if (TEST_OPT_DEBUG)
     
    216210        if (at <= strat->Ll)
    217211        {
     212          /*test if h is already standardbasis element*/
     213#ifdef HAVE_HOMOG_T
     214          i=strat->tl+1;
     215#else
    218216          i=strat->sl+1;
     217#endif
    219218          do
    220219          {
    221220            i--;
    222221            if (i<0) return;
     222#ifdef HAVE_HOMOG_T
     223          } while (!pDivisibleBy1(strat->T[i].p,(*h).p));
     224#else
    223225          } while (!pDivisibleBy1(strat->S[i],(*h).p));
     226#endif       
    224227          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    225228          if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
     
    367370        if (at <= strat->Ll)
    368371        {
     372#ifdef HAVE_HOMOG_T
     373          i=strat->tl+1;
     374#else
    369375          i=strat->sl+1;
     376#endif
    370377          do
    371378          {
    372379            i--;
    373380            if (i<0) return;
     381#ifdef HAVE_HOMOG_T
     382          } while (!pDivisibleBy1(strat->T[i].p,(*h).p));
     383#else
    374384          } while (!pDivisibleBy1(strat->S[i],(*h).p));
     385#endif       
    375386          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    376387          if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
     
    429440        wrp(strat->T[j].p);
    430441      }
    431       (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether,
    432                           strat->spSpolyLoop);
     442      (*h).p = ksOldSpolyRed(strat->T[j].p,(*h).p,strat->kNoether);
    433443      if (TEST_OPT_DEBUG)
    434444      {
     
    468478        if (at <= strat->Ll)
    469479        {
     480#ifdef HAVE_HOMOG_T
     481          i=strat->tl+1;
     482#else
    470483          i=strat->sl+1;
     484#endif
    471485          do
    472486          {
    473487            i--;
    474488            if (i<0) return;
     489#ifdef HAVE_HOMOG_T
     490          } while (!pDivisibleBy1(strat->T[i].p,(*h).p));
     491#else
    475492          } while (!pDivisibleBy1(strat->S[i],(*h).p));
     493#endif       
    476494          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    477495          if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
     
    617635        if (at <= strat->Ll)
    618636        {
     637#ifdef HAVE_HOMOG_T
     638          i=strat->tl+1;
     639#else
    619640          i=strat->sl+1;
     641#endif
    620642          do
    621643          {
    622644            i--;
    623645            if (i<0) return;
     646#ifdef HAVE_HOMOG_T
     647          } while (!pDivisibleBy1(strat->T[i].p,(*h).p));
     648#else
    624649          } while (!pDivisibleBy1(strat->S[i],(*h).p));
     650#endif       
    625651          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    626652          if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
     
    910936      {
    911937        pFree1(strat->L[j].p);    /*deletes the short spoly and computes*/
    912         strat->L[j].p=spSpolyCreate(strat->L[j].p1,
     938        strat->L[j].p=ksOldCreateSpoly(strat->L[j].p1,
    913939                                    strat->L[j].p2,
    914                                     strat->kNoether,
    915                                     strat->spSpolyLoop);   /*the real one*/
     940                                    strat->kNoether);   /*the real one*/
    916941        if (!strat->honey)
    917942          strat->initEcart(&strat->L[j]);
     
    951976      {
    952977        pFree1(strat->L[i].p);
    953         strat->L[i].p = spSpolyCreate(strat->L[i].p1,
    954                                       strat->L[i].p2,
    955                                       strat->kNoether,
    956                                       strat->spSpolyLoop);
     978        strat->L[i].p = ksOldCreateSpoly(strat->L[i].p1,
     979                                         strat->L[i].p2,
     980                                         strat->kNoether);
     981       
     982                                     
    957983        strat->L[i].ecart = pLDeg(strat->L[i].p,&strat->L[i].length)-pFDeg(strat->L[i].p);
    958984      }
     
    10411067  int i;
    10421068
    1043 #ifdef SDRING
    1044   if (pSDRING
    1045   && (atS<=strat->sl)
    1046   && pComparePolys(p.p,strat->S[atS]))
    1047   {
    1048     if (TEST_OPT_PROT)
    1049       PrintS("m");
    1050     p.p=NULL;
    1051     return;
    1052   }
    1053   if (pSDRING
    1054   && (atS<strat->sl)
    1055   && pComparePolys(p.p,strat->S[atS+1]))
    1056   {
    1057     if (TEST_OPT_PROT)
    1058       PrintS("m");
    1059     p.p=NULL;
    1060     return;
    1061   }
    1062   if (pSDRING
    1063   && (atS>0)
    1064   && pComparePolys(p.p,strat->S[atS-1]))
    1065   {
    1066     if (TEST_OPT_PROT)
    1067       PrintS("m");
    1068     p.p=NULL;
    1069     return;
    1070   }
    1071 #endif
    10721069  strat->news = TRUE;
    10731070  /*- puts p to the standardbasis s at position atS -*/
     
    12481245  int hilbeledeg=1,hilbcount=0;
    12491246
    1250 #ifdef SDRING
    1251   polyset aug=(polyset)Alloc(setmax*sizeof(poly));
    1252   int augmax=setmax, augl=-1;
    1253   poly oldLcm;
    1254 #endif
    1255 
    12561247  strat->update = TRUE;
    12571248  /*- setting global variables ------------------- -*/
     
    13151306    {
    13161307      pFree1(strat->P.p);/*- deletes the short spoly and computes -*/
    1317       strat->P.p = spSpolyCreate(strat->P.p1,
    1318                                  strat->P.p2,
    1319                                  strat->kNoether,
    1320                                  strat->spSpolyLoop);/*- the real one -*/
     1308      strat->P.p = ksOldCreateSpoly(strat->P.p1,
     1309                                    strat->P.p2,
     1310                                    strat->kNoether);/*- the real one -*/
    13211311      if (!strat->honey)
    13221312        strat->initEcart(&strat->P);
     
    13241314        strat->P.length = pLength(strat->P.p);
    13251315    }
    1326 #ifdef SDRING
    1327     if (strat->P.p != NULL)
    1328 #endif
    13291316    {
    13301317      if (TEST_OPT_PROT) message(strat->P.ecart+pFDeg(strat->P.p),&olddeg,&reduc,strat);
     
    13331320    if (strat->P.p != NULL)
    13341321    {
    1335 #ifdef SDRING
    1336       aug[0]=strat->P.p;
    1337       augl=0;
    1338       if (pSDRING)
    1339       {
    1340         oldLcm=strat->P.lcm;
    1341 #ifdef SRING
    1342         if (pSRING) psAug(pCopy(strat->P.p),pOne(),&aug,&augl,&augmax);
    1343 #endif
    1344 #ifdef DRING
    1345         if (pDRING) pdAug(pCopy(strat->P.p),&aug,&augl,&augmax);
    1346 #endif
    1347       }
    1348       for (augl++;augl != 0;)
    1349       {
    1350         strat->P.p=aug[--augl];
    1351         if (pSDRING)
    1352         {
    1353           if (oldLcm==NULL) strat->P.lcm=NULL;
    1354           else  strat->P.lcm=pCopy1(oldLcm);
    1355         }
    1356         if ((augl!=0) && (strat->P.p!=NULL)) strat->red(&strat->P,strat);
    1357         if (strat->P.p != NULL)
    1358         {
    1359 #endif
    13601322          if (TEST_OPT_PROT) PrintS("s");/*- statistic -*/
    13611323          /*- enter P.p into s and b: -*/
     
    13781340          {
    13791341            int pos;
    1380 #ifdef SDRING
    1381             pos = posInS(strat->S,strat->sl,strat->P.p);
    1382             if (pSDRING && (pos<=strat->sl)
    1383             && (pComparePolys(strat->P.p,strat->S[pos])))
    1384             {
    1385               if (TEST_OPT_PROT)
    1386                 PrintS("d");
    1387             }
    1388             else
    1389 #endif
    13901342            {
    13911343              enterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat);
     
    14041356          if (strat->P.lcm!=NULL) pFree1(strat->P.lcm);
    14051357          strat->P.lcm=NULL;
    1406 #ifdef SDRING
    1407         }
    1408       }
    1409       /* delete the old pair */
    1410       if (pSDRING &&(oldLcm!=NULL)) pFree1(oldLcm);
    1411 #endif
    14121358#ifdef KDEBUG
    14131359      memset(&strat->P,0,sizeof(strat->P));
     
    14501396  pDelete(&strat->kNoether);
    14511397  Free((ADDRESS)strat->NotUsedAxis,(pVariables+1)*sizeof(BOOLEAN));
    1452 #ifdef SDRING
    1453   Free((ADDRESS)aug,augmax*sizeof(poly));
    1454 #endif
    14551398  if (TEST_OPT_PROT) messageStat(srmax,lrmax,hilbcount,strat);
    14561399  if (TEST_OPT_WEIGHTM)
     
    14991442  initBuchMoraPos(strat);
    15001443  initMora(F,strat);
    1501   strat->spSpolyLoop = spGetSpolyLoop(currRing,
    1502                                       max(strat->ak,pMaxComp(q)),
    1503                                       strat->syzComp, FALSE);
    15041444  strat->enterS = enterSMoraNF;
    15051445  /*- set T -*/
     
    15971537  strat->enterS = enterSMoraNF;
    15981538  /*- set T -*/
    1599   strat->spSpolyLoop = spGetSpolyLoop(currRing,
    1600                                       max(strat->ak,idRankFreeModule(q)),
    1601                                       strat->syzComp, FALSE);
    16021539  strat->tl = -1;
    16031540  strat->tmax = setmax;
     
    17231660  }
    17241661  if ((h==testHomog)
    1725 #ifdef DRING
    1726   && (!pDRING)
    1727 #endif
    17281662  )
    17291663  {
     
    17461680  }
    17471681  pLexOrder=b;
    1748 #ifdef DRING
    1749   if (pDRING) h=isNotHomog;
    1750 #endif
    17511682  if (h==isHomog)
    17521683  {
     
    17651696  }
    17661697  strat->homog=h;
    1767   spSet(currRing);
    1768   strat->spSpolyLoop = spGetSpolyLoop(currRing, strat, syzComp);
    17691698  if (pOrdSgn==-1)
    17701699  {
     
    17761705  else
    17771706  {
    1778     #ifdef STDTRACE
    1779     lists l;
    1780     if (w!=NULL)
    1781       l=bbaLink(F,Q,*w,hilb,strat);
    1782     else
    1783       l=bbaLink(F,Q,NULL,hilb,strat);
    1784     r=(ideal)(l->m[0].data);
    1785     l->m[0].data=NULL;
    1786     l->Clean();
    1787     #else
    17881707    if (w!=NULL)
    17891708      r=bba(F,Q,*w,hilb,strat);
    17901709    else
    17911710      r=bba(F,Q,NULL,hilb,strat);
    1792     #endif
    17931711  }
    17941712#ifdef KDEBUG
     
    18131731//##############################################################
    18141732//##############################################################
    1815 
    1816 #ifdef STDTRACE
    1817 lists TraceStd(leftv lv,int rw, ideal F, ideal Q, tHomog h,intvec ** w, intvec *hilb,int syzComp,
    1818           int newIdeal)
    1819 {
    1820   lists l;
    1821   ideal r;
    1822   stdLink stdTrace=(stdLink) Alloc0(sizeof(skstdLink));
    1823   BOOLEAN b=pLexOrder,toReset=FALSE;
    1824   BOOLEAN delete_w=(w==NULL);
    1825   kStrategy strat=(kStrategy)Alloc0(sizeof(skStrategy));
    1826 
    1827   if(!TEST_OPT_RETURN_SB)
    1828     strat->syzComp = syzComp;
    1829   if (TEST_OPT_SB_1)
    1830     strat->newIdeal = newIdeal;
    1831   strat->LazyPass=32000;
    1832   strat->LazyDegree = 10;
    1833   strat->ak = idRankFreeModule(F);
    1834 //   if(stdTrace!=NULL)
    1835 //     stdTrace->GetPrimes(F,primes);  // Array mit Primzahlen muß geordnet sein !
    1836 
    1837   if ((h==testHomog)
    1838 #ifdef DRING
    1839   && (!pDRING)
    1840 #endif
    1841   )
    1842   {
    1843     if (strat->ak == 0)
    1844     {
    1845       h = (tHomog)idHomIdeal(F,Q);
    1846       w=NULL;
    1847     }
    1848     else
    1849       h = (tHomog)idHomModule(F,Q,w);
    1850   }
    1851 #ifdef DRING
    1852   if (pDRING) h=isNotHomog;
    1853 #endif
    1854   if (h==isHomog)
    1855   {
    1856     if ((w!=NULL) && (*w!=NULL))
    1857     {
    1858       kModW = *w;
    1859       strat->kModW = *w;
    1860       pOldFDeg = pFDeg;
    1861       pFDeg = kModDeg;
    1862       toReset = TRUE;
    1863     }
    1864     pLexOrder = TRUE;
    1865     if (hilb==NULL) strat->LazyPass*=2;
    1866   }
    1867   strat->homog=h;
    1868   spSet(currRing);
    1869   strat->spSpolyLoop = spGetSpolyLoop(currRing, strat syzComp);
    1870 //   if (pOrdSgn==-1)
    1871 //   {
    1872 //     if (w!=NULL)
    1873 //       r=mora(F,Q,*w,hilb,strat);
    1874 //     else
    1875 //       r=mora(F,Q,NULL,hilb,strat);
    1876 //   }
    1877 //   else
    1878   {
    1879     stdTrace->Init(lv,rw);
    1880     if(w==NULL)
    1881       l=bbaLink(F,Q,NULL,hilb,strat,stdTrace);
    1882     else
    1883       l=bbaLink(F,Q,*w,hilb,strat,stdTrace);
    1884     r=(ideal) (l->m[0].Data());
    1885   }
    1886 #ifdef KDEBUG
    1887   int i;
    1888   for (i=0; i<IDELEMS(r); i++) pTest(r->m[i]);
    1889 #endif
    1890   if (toReset)
    1891   {
    1892     kModW = NULL;
    1893     pFDeg = pOldFDeg;
    1894   }
    1895   pLexOrder = b;
    1896 //Print("%d reductions canceled \n",strat->cel);
    1897   HCord=strat->HCord;
    1898   Free((ADDRESS)strat,sizeof(skStrategy));
    1899   if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
    1900   if(stdTrace!=NULL)
    1901   {
    1902     stdTrace->Kill();
    1903     Free(stdTrace, sizeof(skstdLink));
    1904   }
    1905 
    1906   return l;
    1907 }
    1908 #endif
    19091733
    19101734lists min_std(ideal F, ideal Q, tHomog h,intvec ** w, intvec *hilb,int syzComp,
     
    19281752  strat->ak = idRankFreeModule(F);
    19291753  if ((h==testHomog)
    1930 #ifdef DRING
    1931   && (!pDRING)
    1932 #endif
    19331754  )
    19341755  {
     
    19431764    }
    19441765  }
    1945 #ifdef DRING
    1946   if (pDRING) h=isNotHomog;
    1947 #endif
    19481766  if (h==isHomog)
    19491767  {
     
    19701788  }
    19711789  strat->homog=h;
    1972   spSet(currRing);
    1973   strat->spSpolyLoop = spGetSpolyLoop(currRing, strat, syzComp);
    19741790  if (pOrdSgn==-1)
    19751791  {
     
    19811797  else
    19821798  {
    1983   #ifdef STDTRACE
    1984     lists rl;
    1985     if (w!=NULL)
    1986       rl=bbaLink(F, Q, *w, hilb, strat, NULL);
    1987     else
    1988       rl=bbaLink(F, Q, NULL, hilb, strat, NULL);
    1989     r=(ideal)(rl->m[0].data);
    1990     rl->m[0].data=NULL;
    1991     rl->Clean();
    1992   #else
    19931799    if (w!=NULL)
    19941800      r=bba(F,Q,*w,hilb,strat);
    19951801    else
    19961802      r=bba(F,Q,NULL,hilb,strat);
    1997   #endif
    19981803  }
    19991804#ifdef KDEBUG
     
    20441849  kStrategy strat=(kStrategy)Alloc0(sizeof(skStrategy));
    20451850  strat->syzComp = syzComp;
    2046   spSet(currRing);
    20471851  if (pOrdSgn==-1)
    20481852    p=kNF1(F,Q,p,strat,lazyReduce);
     
    20561860{
    20571861  ideal res;
    2058   spSet(currRing);
    20591862  if (TEST_OPT_PROT)
    20601863  {
     
    20881891  strat->kNoether=pCopy(ppNoether);
    20891892  strat->ak = idRankFreeModule(F);
    2090   spSet(currRing);
    20911893  initBuchMoraCrit(strat);
    20921894  strat->NotUsedAxis = (BOOLEAN *)Alloc((pVariables+1)*sizeof(BOOLEAN));
     
    20991901  strat->tmax        = setmax;
    21001902  strat->T           = initT();
    2101   strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    21021903  if (pOrdSgn == -1)   strat->honey = TRUE;
    21031904  initS(F,Q,strat);
Note: See TracChangeset for help on using the changeset viewer.