Changeset 2921f5 in git


Ignore:
Timestamp:
Jun 30, 2006, 10:43:31 AM (18 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
bfcd466f2a497cdcc37609173c8398e5da768bac
Parents:
0025179624f84149e5d9951df92d3f1f9c08474c
Message:
*bricken: improved block orderings


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

Legend:

Unmodified
Added
Removed
  • kernel/tgb.cc

    r002517 r2921f5  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb.cc,v 1.96 2006-06-08 08:12:51 bricken Exp $ */
     7/* $Id: tgb.cc,v 1.97 2006-06-30 08:43:31 bricken Exp $ */
    88/*
    99* ABSTRACT: slimgb and F4 implementation
     
    320320}
    321321#endif
     322
     323static BOOLEAN elength_is_normal_length(poly p, slimgb_alg* c){
     324    ring r=c->r;
     325    if (p_GetComp(p,r)!=0) return FALSE;
     326    if (c->lastDpBlockStart<=pVariables){
     327        int i;
     328        for(i=1;i<=pVariables;i++){
     329            if (p_GetExp(p,i,r)!=0){
     330                break;
     331            }
     332        }
     333        if (i>=c->lastDpBlockStart) {
     334        //wrp(p);
     335        //PrintS("\n");
     336        return TRUE;
     337        }
     338        else return FALSE;
     339    }else
     340    return FALSE;
     341}
     342static BOOLEAN get_last_dp_block_start(ring r){
     343    //ring r=c->r;
     344    int last_block;
     345   
     346    if (rRing_has_CompLastBlock(r)){
     347        last_block=rBlocks(r) - 3;
     348    }
     349    else {last_block=rBlocks(r)-2;}
     350    assume(last_block>=0);
     351    if (r->order[last_block]==ringorder_dp)
     352        return r->block0[last_block];
     353    return pVariables+1;
     354
     355}
     356
    322357static wlen_type do_pELength(poly p, slimgb_alg* c, int dlm=-1){
     358
    323359  if(p==NULL) return 0;
    324360  wlen_type s=0;
     
    369405  }
    370406  if(lm==NULL) return 0;
     407  if(elength_is_normal_length(lm,ca)) {
     408    return bucket_guess(b);
     409  }
    371410  int d=pTotaldegree(lm,ca->r);
    372411  int i;
     
    374413  {
    375414    if(b->buckets[i]==NULL) continue;
     415   
     416    if ((pTotaldegree(b->buckets[i])<=d) &&(elength_is_normal_length(b->buckets[i],ca))){
     417        s+=b->buckets_length[i];
     418    } else
     419    {
    376420    s+=do_pELength(b->buckets[i],ca,d);
     421    }
    377422  }
    378423  return s;
     
    381426static inline int pELength(poly p, slimgb_alg* c,int l){
    382427  if (p==NULL) return 0;
     428  if ((l>0) &&(elength_is_normal_length(p,c)))
     429    return l;
    383430  return do_pELength(p,c);
    384431}
     
    21112158  r=currRing;
    21122159  nc=rIsPluralRing(r);
    2113 
     2160  this->lastDpBlockStart=get_last_dp_block_start(r);
     2161  //Print("last dp Block start: %i\n", this->lastDpBlockStart);
    21142162  is_homog=TRUE;
    21152163  {
Note: See TracChangeset for help on using the changeset viewer.