Changeset f53fdf in git


Ignore:
Timestamp:
Nov 12, 2008, 1:42:12 PM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
f13d949e655e53400261250ef5a9a2c2f11e2585
Parents:
10ed4a32f6e1ce3b10d657bf4a383d3f98265df2
Message:
*redHoeny wityh buckets


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

Legend:

Unmodified
Added
Removed
  • kernel/kstd2.cc

    r10ed4a3 rf53fdf  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.75 2008-08-14 13:00:34 wienand Exp $ */
     4/* $Id: kstd2.cc,v 1.76 2008-11-12 12:42:12 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    631631  //if (h->GetLmTailRing()==NULL) return 0; // HS: SHOULD NOT BE NEEDED!
    632632  assume(h->FDeg == h->pFDeg());
    633 
    634633  poly h_p;
    635634  int i,j,at,pass,ei, ii, h_d;
     
    643642  h_p = h->GetLmTailRing();
    644643  not_sev = ~ h->sev;
     644
     645  h->PrepareRed(strat->use_buckets);
    645646  loop
    646647  {
    647     j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
     648    j=kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
    648649    if (j < 0) return 1;
    649650
    650651    ei = strat->T[j].ecart;
    651652    li = strat->T[j].pLength;
    652     #if 0
    653     if (li==0)
    654     {
    655        //PrintS("!");
    656        li=strat->T[j].pLength=pLength(strat->T[j].p);
    657     }
    658     #endif
    659653    ii = j;
    660654    /*
     
    694688    if (!K_TEST_OPT_REDTHROUGH && (pass!=0) && (ei > h->ecart))
    695689    {
     690      h->GetTP(); // clears bucket
    696691      h->SetLmCurrRing();
    697692      /*
     
    726721    assume(strat->fromT == FALSE);
    727722
    728 #if 0 // test poly exchange
    729     if (strat->inStdFac==0)
    730     {
    731       int ll;
    732       poly t_p;
    733       if (strat->tailRing==currRing)
    734         t_p=strat->T[ii].p;
    735       else
    736         t_p=strat->T[ii].t_p;
    737       if ((p_LmCmp(h_p,t_p,strat->tailRing)==0)
    738       && ((ll=h->GuessLength()) < strat->T[ii].pLength))
    739       {
    740         h->GetP();
    741         if ((h->pLength=h->GetpLength()) < strat->T[ii].pLength)
    742         {
    743           if (TEST_OPT_PROT)  PrintS("e");
    744           h->GetP();
    745           if (h->p!=NULL)
    746           {
    747             if (strat->T[ii].p!=NULL)
    748             {
    749               poly swap;
    750               omTypeAlloc0Bin(poly,swap,currRing->PolyBin);
    751               memcpy(swap,h->p,currRing->PolyBin->sizeW*sizeof(long));
    752               memcpy(h->p,strat->T[ii].p,currRing->PolyBin->sizeW*sizeof(long));
    753               memcpy(strat->T[ii].p,swap,currRing->PolyBin->sizeW*sizeof(long));
    754               omFreeBinAddr(swap);
    755             }
    756             else
    757             {
    758               strat->T[ii].p=h->p;
    759               h->p=NULL;
    760             }
    761           }
    762           else
    763           {
    764             if (strat->T[ii].p!=NULL)
    765             {
    766               h->p=strat->T[ii].p;
    767               strat->T[ii].p=NULL;
    768             }
    769             // else: all NULL
    770           }
    771           if (h->t_p!=NULL)
    772           {
    773             if (strat->T[ii].t_p!=NULL)
    774             {
    775               poly swap;
    776               omTypeAlloc0Bin(poly,swap,strat->tailRing->PolyBin);
    777               memcpy(swap,h->t_p,strat->tailRing->PolyBin->sizeW*sizeof(long));
    778               memcpy(h->t_p,strat->T[ii].t_p,strat->tailRing->PolyBin->sizeW*sizeof(long));
    779               memcpy(strat->T[ii].t_p,swap,strat->tailRing->PolyBin->sizeW*sizeof(long));
    780               omFreeBinAddr(swap);
    781             }
    782             else
    783             {
    784               strat->T[ii].t_p=h->t_p;
    785               h->t_p=NULL;
    786             }
    787           }
    788           else
    789           {
    790             if (strat->T[ii].t_p!=NULL)
    791             {
    792               h->t_p=strat->T[ii].t_p;
    793               strat->T[ii].t_p=NULL;
    794             }
    795             // else: all NULL
    796           }
    797           if (strat->tailRing != currRing && (strat->T[ii].p != NULL)
    798           && pNext(strat->T[ii].p) != NULL)
    799              strat->T[ii].max =p_GetMaxExpP(pNext(strat->T[ii].p), strat->tailRing);
    800           else
    801              strat->T[ii].max = NULL;
    802           h->length=h->pLength=pLength(h->p);
    803           strat->T[ii].length=strat->T[ii].pLength=pLength(strat->T[ii].p);
    804           if (strat->T[ii].is_normalized)
    805           {
    806             strat->T[ii].is_normalized=0;
    807             strat->T[ii].pNorm();
    808           }
    809           else
    810           {
    811             if (TEST_OPT_INTSTRATEGY)
    812               strat->T[ii].pCleardenom();
    813           }
    814           h->PrepareRed(strat->use_buckets);
    815         }
    816       }
    817     }
    818 #endif // test poly exchange
    819     ksReducePoly(h, &(strat->T[ii]), NULL, NULL, strat);
    820 
     723    number coef;
     724    ksReducePoly(h,&(strat->T[ii]),strat->kNoetherTail(),&coef,strat);
    821725#ifdef KDEBUG
    822726    if (TEST_OPT_DEBUG)
    823727    {
    824       PrintS("\nto ");
     728      PrintS("\nto:");
    825729      h->wrp();
    826730      PrintLn();
    827731    }
    828732#endif
    829 
    830     h_p = h->GetLmTailRing();
    831     if (h_p == NULL)
    832     {
     733    if(h->IsNull())
     734    {
     735      h->Clear();
    833736      if (h->lcm!=NULL) pLmFree(h->lcm);
    834 #ifdef KDEBUG
     737      #ifdef KDEBUG
    835738      h->lcm=NULL;
    836 #endif
     739      #endif
    837740      return 0;
    838741    }
     
    843746    if (ei <= h->ecart)
    844747      h->ecart = d-h_d;
    845     else
     748    else 
    846749      h->ecart = d-h_d+ei-h->ecart;
     750
    847751    /*
    848752     * try to reduce the s-polynomial h
     
    855759    if (!K_TEST_OPT_REDTHROUGH && (strat->Ll >= 0) && ((d > reddeg) || (pass > strat->LazyPass)))
    856760    {
     761      h->GetTP(); // clear bucket
    857762      h->SetLmCurrRing();
    858763      at = strat->posInL(strat->L,strat->Ll,h,strat);
     
    873778    else if (TEST_OPT_PROT && (strat->Ll < 0) && (d > reddeg))
    874779    {
     780      h->wrp(); Print("<%d>\n",h->GetpLength());
    875781      reddeg = d;
    876782      Print(".%d",d); mflush();
Note: See TracChangeset for help on using the changeset viewer.