Changeset 4f006f in git for Singular/tgb.cc


Ignore:
Timestamp:
Mar 2, 2003, 9:14:04 AM (21 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
6cf1919180db9e6de9ce32ce1d9103622b929d39
Parents:
d6f4d943dc9e5df16732b62b38b67a0be4f90de3
Message:
* bricken: new structures, cleaning


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

Legend:

Unmodified
Added
Removed
  • Singular/tgb.cc

    rd6f4d9 r4f006f  
    12651265    buf[i].p=h;
    12661266    buf[i].sev=pGetShortExpVector(h);
     1267    buf[i].sum=NULL;
    12671268    buf[i].bucket = kBucketCreate(currRing);
    12681269    kBucketInit(buf[i].bucket,buf[i].p,len);
     
    15431544ideal t_rep_gb(ring r,ideal arg_I){
    15441545   Print("Idelems %i \n----------\n",IDELEMS(arg_I));
    1545   ideal I_temp=idCopy(arg_I); //kInterRed(arg_I);
    1546   ideal I=idCompactify(I_temp);
     1546  ideal I=idCompactify(arg_I);
    15471547  qsort(I->m,IDELEMS(I),sizeof(poly),poly_crit);
    1548   idDelete(&I_temp);
    15491548  Print("Idelems %i \n----------\n",IDELEMS(I));
    15501549  calc_dat* c=(calc_dat*) omalloc(sizeof(calc_dat));
     
    15551554  while(c->pair_top>=0)
    15561555    go_on(c);
    1557    omfree(c->rep);
     1556
    15581557  for(int z=0;z<c->n;z++){
    15591558    omfree(c->states[z]);
     
    15751574  printf("calculated %d NFs\n",c->normal_forms);
    15761575  printf("applied %i product crit, %i extended_product crit \n", c->easy_product_crit, c->extended_product_crit);
    1577   I=c->S;
     1576  int deleted_form_c_s=0;
     1577
     1578  for(i=0;i<c->n;i++){
     1579    if (c->rep[i]!=i){
     1580      for(int j=0;j<=c->strat->sl;j++){
     1581        if(c->strat->S[j]==c->S->m[i]){
     1582          c->strat->S[j]=NULL;
     1583          break;
     1584        }
     1585      }
     1586      PrintS("R_delete");
     1587      pDelete(&c->S->m[i]);
     1588    }
     1589  }
     1590  for(i=0;i<=c->strat->sl;i++){
     1591    if (!c->strat->S[i]) continue;
     1592    BOOLEAN found=FALSE;
     1593    for(int j=0;j<c->n;j++){
     1594      if (c->S->m[j]==c->strat->S[i]){
     1595        found=TRUE;
     1596        break;
     1597      }
     1598    }
     1599    if(!found) pDelete(&c->strat->S[i]);
     1600  }
     1601  omfree(c->rep);
     1602    I=c->S;
    15781603  IDELEMS(I)=c->n;
     1604
     1605  idSkipZeroes(c->S);
     1606 
     1607
    15791608  omfree(c);
    15801609
     
    23172346  return;
    23182347}
     2348void red_object::flatten(){
     2349  if (sum!=NULL)
     2350  {
     2351
     2352 
     2353    if(kBucketGetLm(sum->ac->bucket)!=NULL){
     2354      number mult_my=n_Mult(sum->c_my,sum->ac->multiplied,currRing);
     2355      poly add_this;
     2356      if(!nIsOne(mult_my))
     2357        kBucket_Mult_n(bucket,mult_my);
     2358      int len;
     2359      poly clear_into;
     2360      kBucketClear(sum->ac->bucket,&clear_into,&len);
     2361      if(sum->ac->counter>1){
     2362        add_this=pCopy(clear_into);
     2363        kBucketInit(bucket,clear_into,len);
     2364      }
     2365      else
     2366        add_this=clear_into;
     2367      pMult_nn(add_this, sum->c_ac);
     2368      nDelete(&sum->c_ac);
     2369      nDelete(&sum->c_my);
     2370      nDelete(&mult_my);
     2371      delete sum;
     2372      kBucket_Add_q(bucket,add_this, &len);
     2373      sum->ac->decrease_counter();
     2374     
     2375    }
     2376  }
     2377}
     2378void red_object::validate(){
     2379  if(sum!=NULL)
     2380  {
     2381    poly lm=kBucketGetLm(bucket);
     2382    poly lm_ac=kBucketGetLm(sum->ac->bucket);
     2383    if ((lm_ac==NULL)||((lm!=NULL) && (pLmCmp(lm,lm_ac)!=-1))){
     2384      flatten();
     2385      p=kBucketGetLm(bucket);
     2386    }
     2387    else
     2388    {
     2389      p=lm_ac;
     2390    }
     2391   
     2392  }
     2393  else
     2394    p=kBucketGetLm(bucket);
     2395
     2396}
Note: See TracChangeset for help on using the changeset viewer.