Changeset f224d85 in git for libpolys


Ignore:
Timestamp:
Sep 24, 2012, 2:52:20 PM (12 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '6e5adcba05493683b94648c659a729c189812c77')
Children:
92296297754bdb3c65ffad980c8e982ef37cf33b
Parents:
abe5c8b5ebdd2be025cd137e4a089c3780efb8a3
Message:
fix: removing last from p_*templates and k* routines
Location:
libpolys/polys/templates
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.