Changeset 86aa6a1 in git


Ignore:
Timestamp:
Jun 27, 2008, 2:10:58 PM (15 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
Children:
bb7a4d8ceb25776da1ef2e024e02fd76ff2928e4
Parents:
3b7e975b373f57a1e6cb135cc3765f937f180e12
Message:
+ deg in exp


git-svn-id: file:///usr/local/Singular/svn/trunk@10812 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/tgb.cc

    r3b7e97 r86aa6a1  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb.cc,v 1.156 2008-06-25 08:49:21 bricken Exp $ */
     7/* $Id: tgb.cc,v 1.157 2008-06-27 12:10:58 bricken Exp $ */
    88/*
    99* ABSTRACT: slimgb and F4 implementation
     
    2424#include "gring.h"
    2525#include "sca.h"
    26 
     26#include "prCopy.h"
    2727#include "longrat.h"
    2828#include "modulop.h"
     
    441441  }
    442442  int d=ca->pTotaldegree(lm);
    443   #if 1
     443  #if 0
    444444  assume(sugar>=d);
    445445  s=1+(bucket_guess(b)-1)*(sugar-d+1);
     
    454454    if(b->buckets[i]==NULL) continue;
    455455
    456     if ((pTotaldegree(b->buckets[i])<=d) &&(elength_is_normal_length(b->buckets[i],ca))){
     456    if ((ca->pTotaldegree(b->buckets[i])<=d) &&(elength_is_normal_length(b->buckets[i],ca))){
    457457        s+=b->buckets_length[i];
    458458    } else
     
    12721272sorted_pair_node** add_to_basis_ideal_quotient(poly h, slimgb_alg* c, int* ip)
    12731273{
    1274 
     1274  p_Test(h,c->r);
    12751275  assume(h!=NULL);
    12761276  poly got=gcd_of_terms(h,c->r);
     
    14771477    pLcm(c->S->m[i], c->S->m[j], lm);
    14781478    pSetm(lm);
     1479    p_Test(lm,c->r);
    14791480    s->deg=c->pTotaldegree(lm);
    14801481
     
    14861487      //Print("\n max: %d\n",max(t_i,t_j));
    14871488    }
     1489    p_Test(lm,c->r);
    14881490    s->lcm_of_lm=lm;
    14891491    //          pDelete(&short_s);
     
    15511553    else
    15521554    {
     1555      p_Test(nodes[lower]->lcm_of_lm,c->r);
    15531556      nodes[lower]->lcm_of_lm=pCopy(nodes[lower]->lcm_of_lm);
    15541557      assume(_p_GetComp(c->S->m[nodes[lower]->i],c->r)==_p_GetComp(c->S->m[nodes[lower]->j],c->r));
     
    19441947    sorted_pair_node*** sbuf=(sorted_pair_node***) omalloc(pn*sizeof(sorted_pair_node**));
    19451948    for(j=0;j<pn;j++){
     1949      p_Test(p[j],c->r);
    19461950      sbuf[j]=add_to_basis_ideal_quotient(p[j],c,ibuf+j);
    19471951    }
     
    24622466      if (c->nc){
    24632467        h= nc_CreateSpoly(c->S->m[s->i], c->S->m[s->j]/*, NULL*/, c->r);
     2468       
    24642469        if (h!=NULL)
    24652470          pCleardenom(h);
     
    24682473#endif
    24692474        h=ksOldCreateSpoly(c->S->m[s->i], c->S->m[s->j], NULL, c->r);
    2470     }
    2471     else
     2475    p_Test(h,c->r);
     2476    }
     2477    else{
    24722478      h=s->lcm_of_lm;
     2479      p_Test(h,c->r);
     2480  }
    24732481    // if(s->i>=0)
    24742482//       now_t_rep(s->j,s->i,c);
    24752483    number coef;
    24762484    int mlen=pLength(h);
     2485    p_Test(h,c->r);
    24772486    if ((!c->nc)&(!(use_noro))){
    24782487      h=redNF2(h,c,mlen,coef,2);
     
    24802489      nDelete(&coef);
    24812490    }
     2491    p_Test(h,c->r);
    24822492    free_sorted_pair_node(s,c->r);
    24832493    if(!h) continue;
     
    25362546  red_object* buf=(red_object*) omalloc(i*sizeof(red_object));
    25372547  for(j=0;j<i;j++){
     2548    p_Test(p[j],c->r);
    25382549    buf[j].p=p[j];
    25392550    buf[j].sev=pGetShortExpVector(p[j]);
    25402551    buf[j].bucket = kBucketCreate(currRing);
     2552    p_Test(p[j],c->r);
    25412553    if (c->eliminationProblem){
    25422554        buf[j].sugar=c->pTotaldegree_full(p[j]);
     
    26002612    kBucketClear(buf[j].bucket,&p, &len);
    26012613    kBucketDestroy(&buf[j].bucket);
    2602 
     2614    p_Test(p,c->r);
    26032615    //if (!c->nc) {
    26042616      if ((c->tailReductions) ||(lies_in_last_dp_block(p,c))){
     
    26082620      }
    26092621      //}
     2622      p_Test(p,c->r);
    26102623      add_those[j]=p;
    26112624
     
    28092822        simplify_poly(p,r);
    28102823        si->expected_length=pQuality(p,this,pLength(p));
     2824        p_Test(p,r);
    28112825        si->deg=this->pTotaldegree_full(p);
    28122826        /*if (!rField_is_Zp(r)){
     
    28142828          pCleardenom(p);
    28152829        }*/
     2830       
    28162831        si->lcm_of_lm=p;
    28172832
     
    28262841  omfree(si_array);
    28272842}
    2828 slimgb_alg::slimgb_alg(ideal I, int syz_comp,BOOLEAN F4){
    2829 
     2843slimgb_alg::slimgb_alg(ideal I, int syz_comp,BOOLEAN F4,int deg_pos){
     2844  this->deg_pos=deg_pos;
    28302845  lastCleanedDeg=-1;
    28312846  completed=FALSE;
     
    31913206ideal t_rep_gb(ring r,ideal arg_I, int syz_comp, BOOLEAN F4_mode){
    31923207
     3208    assume(r==currRing);
     3209    ring orig_ring=r;
     3210    int pos;
     3211    ring new_ring=rAssure_TDeg(orig_ring,1,rVar(orig_ring),pos);
     3212
     3213
     3214    ideal s_h;
     3215    if (orig_ring != new_ring)
     3216    {
     3217        rChangeCurrRing(new_ring);
     3218        s_h=idrCopyR_NoSort(arg_I,orig_ring);
     3219        idTest(s_h);
     3220        /*int i;
     3221       
     3222        for(i=0;i<IDELEMS(s_h);i++){
     3223            poly p=s_h->m[i];
     3224            while(p){
     3225                p_Setm(p,new_ring);
     3226                pIter(p);
     3227            }
     3228        }*/
     3229    }
     3230    else
     3231    {
     3232        s_h = id_Copy(arg_I,orig_ring);
     3233    }
     3234
     3235    ideal s_result=do_t_rep_gb(new_ring,s_h,syz_comp,F4_mode,pos);
     3236    ideal result;
     3237    if(orig_ring != new_ring)
     3238    {   
     3239       
     3240        idTest(s_result);
     3241        rChangeCurrRing(orig_ring);
     3242        result = idrMoveR_NoSort(s_result, new_ring);
     3243       
     3244        idTest(result);
     3245        //rChangeCurrRing(new_ring);
     3246        rKill(new_ring);
     3247        //rChangeCurrRing(orig_ring);
     3248    }
     3249    else
     3250        result=s_result;
     3251    idTest(result);
     3252    return result;
     3253}
     3254   
     3255 
     3256
     3257ideal do_t_rep_gb(ring r,ideal arg_I, int syz_comp, BOOLEAN F4_mode,int deg_pos){
     3258
    31933259  //  Print("QlogSize(0) %d, QlogSize(1) %d,QlogSize(-2) %d, QlogSize(5) %d\n", QlogSize(nlInit(0)),QlogSize(nlInit(1)),QlogSize(nlInit(-2)),QlogSize(nlInit(5)));
    31943260
     
    32003266  //if (debug_Ideal) PrintS("DebugIdeal received\n");
    32013267  // Print("Idelems %i \n----------\n",IDELEMS(arg_I));
    3202   ideal I=idCopy(arg_I);
     3268  ideal I=arg_I;
    32033269  idCompactify(I);
    32043270  if (idIs0(I)) return I;
     
    32153281  //slimgb_alg* c=(slimgb_alg*) omalloc(sizeof(slimgb_alg));
    32163282  //int syz_comp=arg_I->rank;
    3217   slimgb_alg* c=new slimgb_alg(I, syz_comp,F4_mode);
     3283  slimgb_alg* c=new slimgb_alg(I, syz_comp,F4_mode,deg_pos);
    32183284
    32193285
     
    35663632    t=t->next;
    35673633  }
    3568 
     3634  p_Setm(m,r);
    35693635  if (max_g_0>0)
    35703636    return m;
  • kernel/tgb_internal.h

    r3b7e97 r86aa6a1  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb_internal.h,v 1.71 2008-06-25 08:49:22 bricken Exp $ */
     7/* $Id: tgb_internal.h,v 1.72 2008-06-27 12:10:58 bricken Exp $ */
    88/*
    99 * ABSTRACT: tgb internal .h file
     
    181181{
    182182  public:
    183     slimgb_alg(ideal I, int syz_comp,BOOLEAN F4);
     183    slimgb_alg(ideal I, int syz_comp,BOOLEAN F4,int deg_pos);
    184184                void introduceDelayedPairs(poly* pa,int s);
    185185    virtual ~slimgb_alg();
     
    241241  int lastDpBlockStart;
    242242  int lastCleanedDeg;
     243  int deg_pos;
    243244  BOOLEAN use_noro;
    244245  BOOLEAN use_noro_last_block;
     
    254255  #endif
    255256  unsigned long pTotaldegree(poly p){
    256       return ::pTotaldegree(p,this->r);
     257      pTest(p);
     258      //assume(pDeg(p,r)==::pTotaldegree(p,r));
     259      assume(::pTotaldegree(p,r)==p->exp[deg_pos]);
     260      return p->exp[deg_pos];
     261      //return ::pTotaldegree(p,this->r);
    257262  }
    258263  int pTotaldegree_full(poly p){
     
    301306static void do_this_spoly_stuff(int i,int j,slimgb_alg* c);
    302307//ideal t_rep_gb(ring r,ideal arg_I);
     308ideal do_t_rep_gb(ring r,ideal arg_I, int syz_comp, BOOLEAN F4_mode,int deg_pos);
    303309static BOOLEAN has_t_rep(const int & arg_i, const int & arg_j, slimgb_alg* state);
    304310static int* make_connections(int from, poly bound, slimgb_alg* c);
Note: See TracChangeset for help on using the changeset viewer.