Changeset 2933bb in git for Singular/kstd2.cc


Ignore:
Timestamp:
Sep 27, 1999, 2:52:49 PM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
Children:
b4b8d2106fa7d6bd9e9fafab0fa53237e4f97fea
Parents:
01e06d33e7200c899a77268319368b290f9abec3
Message:
* reductions only with T


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

Legend:

Unmodified
Added
Removed
  • Singular/kstd2.cc

    r01e06d r2933bb  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.27 1999-07-14 13:16:06 Singular Exp $ */
     4/* $Id: kstd2.cc,v 1.28 1999-09-27 12:52:49 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    3131// #include "timer.h"
    3232
     33#define HAVE_HOMOG_T
     34
    3335/*2
    3436* consider the part above syzComp:
     
    8587    wrp(h->p);
    8688  }
     89  i = 0;
     90  j = 0;
    8791  loop
    8892  {
     93#ifdef HAVE_HOMOG_T
     94    if (pDivisibleBy(strat->T[i].p,(*h).p))
     95    {
     96      if ((!exchanged) && (pEqual((*h).p,strat->T[j].p)))
     97      {
     98        j = 0;
     99        while (j<= strat->sl)
     100        {
     101          if (strat->S[j] == strat->T[i].p) break;
     102          j++;
     103        }
     104        if (j > strat->sl) goto NOTFOUND;
     105#else
    89106    if (pDivisibleBy(strat->S[j],(*h).p))
    90107    {
    91108      if ((!exchanged) && (pEqual((*h).p,strat->S[j])))
    92109      {
     110#endif
    93111        q = kFromInput(strat->S[j],strat);
    94112        if (q!=NULL)
     
    105123          strat->S[j] = (*h).p;
    106124          (*h).p = p;
     125#ifndef HAVE_HOMOG_T
    107126          while ((i<=strat->tl) && (strat->T[i].p!=p)) i++;
     127#endif
    108128          if (i<=strat->tl) strat->T[i].p = strat->S[j];
    109           for (i=0;i<=strat->Ll;i++)
    110           {
    111             if (strat->L[i].p1==p) strat->L[i].p1=strat->S[j];
    112             if (strat->L[i].p2==p) strat->L[i].p2=strat->S[j];
     129          int k;
     130          for (k=0;k<=strat->Ll;k++)
     131          {
     132            if (strat->L[k].p1==p) strat->L[k].p1=strat->S[j];
     133            if (strat->L[k].p2==p) strat->L[k].p2=strat->S[j];
    113134          }
    114135        }
     
    121142        wrp(strat->S[j]);
    122143      }
     144#ifdef HAVE_HOMOG_T
     145      (*h).p = spSpolyRed(strat->T[i].p,(*h).p,strat->kNoether,
     146                          strat->spSpolyLoop);
     147#else
    123148      (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether,
    124149                          strat->spSpolyLoop);
     150#endif
    125151      if (TEST_OPT_DEBUG)
    126152      {
     
    136162      }
    137163/*- try to reduce the s-polynomial -*/
     164#ifdef HAVE_HOMOG_T
     165      i = 0;
     166#else
    138167      j = 0;
     168#endif
    139169    }
    140170    else
    141171    {
     172#ifdef HAVE_HOMOG_T
     173NOTFOUND:
     174      if (i >= strat->tl)
     175#else
    142176      if (j >= strat->sl)
     177#endif
    143178      {
    144179        if (exchanged)
     
    173208        return;
    174209      }
     210#ifdef HAVE_HOMOG_T
     211      i++;
     212#else
    175213      j++;
     214#endif
    176215    }
    177216  }
     
    183222*/
    184223
     224// #define HAVE_HOMOG_T
     225
    185226static void redHomog (LObject* h,kStrategy strat)
    186227{
     
    197238    loop
    198239      {
     240#ifdef HAVE_HOMOG_T
     241        if (pDivisibleBy1(strat->T[j].p,(*h).p))
     242#else
    199243        if (pDivisibleBy1(strat->S[j],(*h).p))
     244#endif
    200245        {
    201246          //if (strat->interpt) test_int_std(strat->kIdeal);
     
    206251            wrp(h->p);
    207252            PrintS(" with ");
     253#ifdef HAVE_HOMOG_T
     254            wrp(strat->T[j].p);
     255#else
    208256            wrp(strat->S[j]);
    209           }
     257#endif
     258          }
     259#ifdef HAVE_HOMOG_T
     260          (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether,
     261                              strat->spSpolyLoop);
     262#else
    210263          (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether,
    211264                              strat->spSpolyLoop);
     265#endif
    212266          if (TEST_OPT_DEBUG)
    213267          {
     
    228282        else
    229283        {
     284#ifdef HAVE_HOMOG_T
     285          if (j >= strat->tl)
     286#else
    230287          if (j >= strat->sl)
    231           {
    232             enterTBba((*h),strat->tl+1,strat);
     288#endif           
     289          {
     290            if (TEST_OPT_INTSTRATEGY && strat->homog)
     291            {
     292              pCleardenom(h->p);
     293              enterTBba((*h), strat->posInT(strat->T,strat->tl,(*h)), strat);
     294            }
     295            else
     296              enterTBba((*h),strat->tl+1,strat);
    233297            return;
    234298          }
     
    242306    loop
    243307      {
     308#ifdef HAVE_HOMOG_T
     309        if (pDivisibleBy2(strat->T[j].p,(*h).p))
     310#else
    244311        if (pDivisibleBy2(strat->S[j],(*h).p))
     312#endif
    245313        {
    246314          //if (strat->interpt) test_int_std(strat->kIdeal);
     
    251319            wrp(h->p);
    252320            PrintS(" with ");
     321#ifdef HAVE_HOMOG_T
     322            wrp(strat->T[j].p);
     323#else
    253324            wrp(strat->S[j]);
    254           }
     325#endif
     326          }
     327#ifdef HAVE_HOMOG_T
     328          (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether,
     329                              strat->spSpolyLoop);
     330#else
    255331          (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether,
    256332                              strat->spSpolyLoop);
     333#endif
    257334          if (TEST_OPT_DEBUG)
    258335          {
     
    273350        else
    274351        {
     352#ifdef HAVE_HOMOG_T
     353          if (j >= strat->tl)
     354#else
    275355          if (j >= strat->sl)
    276           {
    277             enterTBba((*h),strat->tl+1,strat);
     356#endif           
     357          {
     358            if (TEST_OPT_INTSTRATEGY && strat->homog)
     359            {
     360              pCleardenom(h->p);
     361              enterTBba((*h), strat->posInT(strat->T,strat->tl,(*h)), strat);
     362            }
     363            else
     364              enterTBba((*h),strat->tl+1,strat);
    278365            return;
    279366          }
     
    284371}
    285372
     373#ifdef KEEP_GARBAGE
    286374/*2
    287375*  reduction procedure for the homogeneous case
     
    386474        else
    387475        {
     476#ifdef HAVE_HOMOG_T
    388477          if (j >= strat->tl)
     478#else
     479          if (j >= strat->sl)
     480#endif           
    389481          {
    390482            //pContent((*h).p);
     
    458550        if (at <= strat->Ll)
    459551        {
     552#ifdef HAVE_HOMOG_T
     553          i=strat->tl+1;
     554#else
    460555          i=strat->sl+1;
     556#endif
    461557          do
    462558          {
     
    468564            }
    469565          }
    470           while (!pDivisibleBy1(strat->S[i],(*h).p));
     566#ifdef HAVE_HOMOG_T
     567          } while (!pDivisibleBy1(strat->T[i],(*h).p));
     568#else
     569          } while (!pDivisibleBy1(strat->S[i],(*h).p));
     570#endif       
    471571          if (TEST_OPT_DEBUG) Print(" ->L[%d]\n",at);
    472572          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     
    498598  }
    499599}
     600
     601#endif // KEEP_GARBAGE
    500602
    501603/*2
     
    638740        {
    639741          /*test if h is already standardbasis element*/
     742#ifdef HAVE_HOMOG_T
     743          i=strat->tl+1;
     744#else
    640745          i=strat->sl+1;
     746#endif
    641747          do
    642748          {
     
    648754              return;
    649755            }
     756#ifdef HAVE_HOMOG_T
     757          } while (!pDivisibleBy1(strat->T[i].p,(*h).p));
     758#else
    650759          } while (!pDivisibleBy1(strat->S[i],(*h).p));
     760#endif       
     761
    651762          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    652763          if (TEST_OPT_DEBUG)
     
    9001011  else if (strat->honey)
    9011012    strat->red = redHoney;
     1013#ifdef KEEP_GARBAGE
    9021014  else if (pLexOrder && !strat->homog)
    9031015    strat->red = redLazy;
    9041016  else if (TEST_OPT_INTSTRATEGY && strat->homog)
    9051017    strat->red = redHomog0;
     1018#endif
    9061019  else
    9071020    strat->red = redHomog;
Note: See TracChangeset for help on using the changeset viewer.