Changeset f224d85 in git


Ignore:
Timestamp:
Sep 24, 2012, 2:52:20 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
92296297754bdb3c65ffad980c8e982ef37cf33b
Parents:
abe5c8b5ebdd2be025cd137e4a089c3780efb8a3
Message:
fix: removing last from p_*templates and k* routines
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • kernel/kInline.h

    rabe5c8 rf224d85  
    546546      if (p != NULL) pNext(p) = NULL;
    547547      pLength = 0;
    548       last = NULL;
    549     }
    550   }
    551 }
    552 
    553 KINLINE void sLObject::SetLmTail(poly lm, poly p_tail, int p_Length, int use_bucket, ring _tailRing, poly _last)
     548    }
     549  }
     550}
     551
     552KINLINE void sLObject::SetLmTail(poly lm, poly p_tail, int p_Length, int use_bucket, ring _tailRing)
    554553{
    555554
     
    561560    pNext(lm) = NULL;
    562561    pLength = 0;
    563     last = NULL;
    564562  }
    565563  else
     
    567565    pNext(lm) = p_tail;
    568566    pLength = p_Length + 1;
    569     last = _last;
    570   }
    571 
     567  }
    572568}
    573569
     
    718714                              new_tailRing->PolyBin,p_shallow_copy_delete,
    719715                              FALSE);
    720   last = NULL;
    721716}
    722717
     
    747742  }
    748743  TObject::Copy();
    749   last = NULL;
    750744}
    751745
    752746KINLINE poly sLObject::CopyGetP()
    753747{
    754   last = NULL;
    755748  if (bucket != NULL)
    756749  {
     
    789782  if (! deg_last || bucket != NULL) return sLObject::pLDeg();
    790783
    791   if (last == NULL || pLength == 0)
    792     last = pLast(GetLmTailRing(), pLength);
    793 #ifdef HAVE_ASSUME
    794784  long ldeg;
    795785  ldeg = tailRing->pLDeg(GetLmTailRing(), &length, tailRing);
     786#ifdef HAVE_ASSUME
     787  if ( pLength == 0)
     788    p_Last(GetLmTailRing(), pLength, tailRing);
    796789  assume ( pLength == length || rIsSyzIndexRing(currRing));
    797   assume (ldeg == tailRing->pFDeg(last,tailRing));
     790#else
     791  pLength=length;
     792#endif
    798793  return ldeg;
    799 #else
    800   length = pLength;
    801   return tailRing->pFDeg(last, tailRing);
    802 #endif
    803794}
    804795
     
    11731164// dummy function for function pointer strat->rewCrit being usable in all
    11741165// possible choices for criteria
    1175 KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, kStrategy strat, int start=0)
     1166KINLINE BOOLEAN arriRewDummy(poly /*sig*/, unsigned long /*not_sevSig*/, kStrategy /*strat*/, int start=0)
    11761167{
    11771168  return FALSE;
  • kernel/kspoly.cc

    rabe5c8 rf224d85  
    386386  poly p1 = Pair->p1;
    387387  poly p2 = Pair->p2;
    388   poly last;
    389388  Pair->tailRing = tailRing;
    390389
     
    454453#endif
    455454
    456   Pair->SetLmTail(m2, a2, l2, use_buckets, tailRing, last);
     455  Pair->SetLmTail(m2, a2, l2, use_buckets, tailRing);
    457456
    458457  // get m2*a2 - m1*a1
  • kernel/kstd1.cc

    rabe5c8 rf224d85  
    265265    // now we finally can reduce
    266266    doRed(h,&(strat->T[ii]),strat->fromT,strat);
    267     h->last=NULL;
    268267    strat->fromT=FALSE;
    269268
  • kernel/kstd2.cc

    rabe5c8 rf224d85  
    900900          /*- h will not become the next element to reduce -*/
    901901        {
    902           h->last=NULL;
    903902          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    904903#ifdef KDEBUG
     
    965964      {
    966965        int dummy=strat->sl;
    967         h->last=NULL;
    968966        if (kFindDivisibleByInS(strat, &dummy, h) < 0)
    969967          return 1;
     
    987985          h->GetP();
    988986          at = strat->posInL(strat->L,strat->Ll,h,strat);
    989           h->last=NULL;
    990987          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    991988          h->Clear();
     
    15171514  LObject L;
    15181515  BOOLEAN withT     = FALSE;
    1519   BOOLEAN newrules  = FALSE;
    15201516  strat->max_lower_index = 0;
    15211517
     
    15721568#endif
    15731569  /* compute------------------------------------------------------- */
    1574   arriAgain:
    15751570  while (strat->Ll >= 0)
    15761571  {
  • kernel/kutil.cc

    rabe5c8 rf224d85  
    251251      bucket = L->bucket;
    252252      L->bucket = NULL;
    253       L->last = NULL;
    254253    }
    255254
     
    267266      if (p_LmCmp(pNext(p1), strat->kNoetherTail(), L->tailRing) == -1)
    268267      {
    269         L->last = p1;
    270268        p_Delete(&pNext(p1), L->tailRing);
    271269        if (p1 == p)
     
    305303        L->pLength = 0;
    306304        L->bucket = bucket;
    307         L->last = NULL;
    308305      }
    309306      else
     
    367364      //if (L->pLength > 0)
    368365      L->pLength = 1;
    369       if (L->last != NULL) L->last = p;
    370366      L->max = NULL;
    371367
     
    764760      return dReportError("L[%d] wrong sev: has %o, specified to have %o",
    765761                          lpos, p_GetShortExpVector(p, r), L->sev);
    766     }
    767     if (lpos > 0 && L->last != NULL && pLast(p) != L->last)
    768     {
    769       return dReportError("L[%d] last wrong: has %p specified to have %p",
    770                           lpos, pLast(p), L->last);
    771762    }
    772763  }
     
    50595050//        critical pair. In this situation we can discard the critical pair
    50605051//        completely.
    5061 BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, kStrategy strat, int start=0)
     5052BOOLEAN arriRewCriterion(poly sig, unsigned long /*not_sevSig*/, kStrategy strat, int start=0)
    50625053{
    50635054  //printf("Arri Rewritten Criterion\n");
     
    52725263  if (strat->redTailChange)
    52735264  {
    5274     L->last = NULL;
    52755265    L->pLength = 0;
    52765266  }
     
    53725362  if (strat->redTailChange)
    53735363  {
    5374     L->last = NULL;
    53755364    L->length = 0;
    53765365  }
     
    54795468  if (strat->redTailChange)
    54805469  {
    5481     L->last = NULL;
    54825470    L->length = 0;
    54835471  }
     
    57955783void initSLSba (ideal F, ideal Q,kStrategy strat)
    57965784{
    5797   int   i,j,pos, ctr=0, ps=0;
     5785  int   i,pos;
    57985786  if (Q!=NULL) i=((IDELEMS(Q)+(setmaxTinc-1))/setmaxTinc)*setmaxTinc;
    57995787  else i=setmaxT;
     
    68786866void enterSSba (LObject p,int atS,kStrategy strat, int atR)
    68796867{
    6880   int i;
    68816868  strat->news = TRUE;
    68826869  /*- puts p to the standardbasis s at position at -*/
     
    87918778* put the pairs (sh \dot s[i],p)  into the set B, ecart=ecart(p)
    87928779*/
    8793 void enterOnePairManyShifts (int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
     8780void enterOnePairManyShifts (int i, poly p, int ecart, int isFromQ, kStrategy strat, int /*atR*/, int uptodeg, int lV)
    87948781{
    87958782  /* p comes from strat->P.p, that is LObject with LM in currRing and Tail in tailRing */
     
    88678854* despite the name, not only self shifts
    88688855*/
    8869 void enterOnePairSelfShifts (poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
     8856void enterOnePairSelfShifts (poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int /*atR*/, int uptodeg, int lV)
    88708857{
    88718858
     
    88988885#endif
    88998886
    8900   poly q, s;
     8887  poly q;
    89018888
    89028889  if (strat->interred_flag) return; // ?
     
    89328919* put the pair (q,p)  into the set B, ecart=ecart(p), q is the shift of some s[i]
    89338920*/
    8934 void enterOnePairShift (poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS, int uptodeg, int lV)
     8921void enterOnePairShift (poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS, int /*uptodeg*/, int lV)
    89358922{
    89368923
     
    94529439  if (strat->redTailChange)
    94539440  {
    9454     L->last = NULL;
    94559441    L->length = 0;
    94569442  }
  • kernel/kutil.h

    rabe5c8 rf224d85  
    192192
    193193  poly  lcm;   /*- the lcm of p1,p2 -*/
    194   poly last;   // pLast(p) during reductions
    195194  kBucket_pt bucket;
    196195  int   i_r1, i_r2;
     
    214213  KINLINE void PrepareRed(BOOLEAN use_bucket);
    215214  KINLINE void SetLmTail(poly lm, poly new_p, int length,
    216                          int use_bucket, ring r, poly last);
     215                         int use_bucket, ring r);
    217216  KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether);
    218217  KINLINE void Tail_Mult_nn(number n);
  • libpolys/polys/templates/p_kBucketSetLm__T.cc

    rabe5c8 rf224d85  
    124124  DECLARE_ORDSGN(const long* ordsgn = r->ordsgn);
    125125  poly p=NULL;
    126   while(p==NULL){
    127       int found=-1000;
    128        for (int i = 1; i<=bucket->buckets_used; i++)
     126  while(p==NULL)
     127  {
     128    int found=-1000;
     129    for (int i = 1; i<=bucket->buckets_used; i++)
     130    {
     131      if (bucket->buckets[i] != NULL)
     132      {
     133        if (p == NULL)
    129134        {
    130           if (bucket->buckets[i] != NULL)
    131           {
    132            
    133             if (p == NULL)
    134             {
    135                 p=bucket->buckets[i];
    136                 found=i;
    137                 continue;
    138             }
    139             assume(p != NULL);
    140             p_MemCmp__T(bucket->buckets[i]->exp, p->exp, length, ordsgn, goto Continue, goto Greater, goto Continue);
    141             //assume(p_LmCmp(bucket->buckets[i],p,r)==1);
    142           Greater:
    143             //if (p_LmCmp(bucket->buckets[i],p,r)!=1) continue;
    144             found=i;
    145             p=bucket->buckets[i];
    146           Continue:;
    147           }
     135          p=bucket->buckets[i];
     136          found=i;
     137          continue;
    148138        }
    149      
    150      
    151       if (found<0) return;
    152       assume(p==bucket->buckets[found]);
    153       assume(p!=NULL);
    154      
    155       p=kBucketExtractLmOfBucket(bucket, found);
    156       assume(p!=NULL);
    157       p_Test(p,r);
    158       poly copy=p_LmInit(p, r);
    159      
    160       for (int i = found+1; i<=bucket->buckets_used; i++)
    161         {
    162          
    163           if (bucket->buckets[i] != NULL)
    164           {
    165             if(p_LmEqual(bucket->buckets[i], copy,r)){
    166                 poly q=kBucketExtractLmOfBucket(bucket,i);
    167                 assume(p!=q);
    168                 p=p_Add_q(p, q,r);
    169                 assume(pLength(bucket->buckets[i])==bucket->buckets_length[i]);
    170             }
    171            
    172    
    173            
    174           }
     139        assume(p != NULL);
     140        p_MemCmp__T(bucket->buckets[i]->exp, p->exp, length, ordsgn, goto Continue, goto Greater, goto Continue);
     141        //assume(p_LmCmp(bucket->buckets[i],p,r)==1);
     142        Greater:
     143        //if (p_LmCmp(bucket->buckets[i],p,r)!=1) continue;
     144        found=i;
     145        p=bucket->buckets[i];
     146        Continue:;
     147      }
     148    }
     149    if (found<0) return;
     150    assume(p==bucket->buckets[found]);
     151    assume(p!=NULL);
     152
     153    p=kBucketExtractLmOfBucket(bucket, found);
     154    assume(p!=NULL);
     155    p_Test(p,r);
     156    poly copy=p_LmInit(p, r);
     157
     158    for (int i = found+1; i<=bucket->buckets_used; i++)
     159    {
     160      if (bucket->buckets[i] != NULL)
     161      {
     162        if(p_LmEqual(bucket->buckets[i], copy,r))
     163        {
     164          poly q=kBucketExtractLmOfBucket(bucket,i);
     165          assume(p!=q);
     166          p=p_Add_q(p, q,r);
     167          assume(pLength(bucket->buckets[i])==bucket->buckets_length[i]);
    175168        }
    176         p_Delete(&copy, r);
     169      }
     170    }
     171    p_Delete(&copy, r);
    177172  }
    178  
     173
    179174  //assume(bucket->buckets[j] != NULL);
    180   assume(pLength(p)==1);
    181   lt = p;
    182  
     175  assume(pLength(lt)==1);
     176
    183177  bucket->buckets[0] = lt;
    184178  bucket->buckets_length[0] = 1;
     
    186180  kBucketAdjustBucketsUsed(bucket);
    187181  kbTest(bucket);
    188   }
     182}
    189183#endif
  • libpolys/polys/templates/pp_Mult_mm__T.cc

    rabe5c8 rf224d85  
    1515 *
    1616 ***************************************************************/
    17 LINKAGE poly pp_Mult_mm__T(poly p, const poly m, const ring ri, poly &last)
     17LINKAGE poly pp_Mult_mm__T(poly p, const poly m, const ring ri)
    1818{
    1919  p_Test(p, ri);
     
    2121  if (p == NULL)
    2222  {
    23     last = NULL;     
    2423    return NULL;
    2524  }
     
    5655  }
    5756  while (p != NULL);
    58   last = q;
    5957  pNext(q) = NULL;
    6058
Note: See TracChangeset for help on using the changeset viewer.