Changeset 29d5f5 in git


Ignore:
Timestamp:
Oct 10, 2004, 12:30:36 PM (20 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
bb816a0c6c07bfea5755e3204da9de713b5ef949
Parents:
2de2a9d3e8f79175378bf84769b7f049bae4b7e5
Message:
*bricken: char 0 optimizing


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

Legend:

Unmodified
Added
Removed
  • Singular/tgb.cc

    r2de2a9d r29d5f5  
    520520  P.p=h; /*p_Copy(h,c->r);*/
    521521  P.FDeg=pFDeg(P.p,c->r);
     522 
    522523  if (!rField_is_Zp(c->r)){
    523524    pCleardenom(P.p);
    524525    pContent(P.p); //is a duplicate call, but belongs here
    525   }
    526  
     526   
     527  }
    527528  else                     
    528529    pNorm(P.p);
    529  
     530  pNormalize(P.p);
    530531
    531532  c->strat->enterS(P,i,c->strat);
     
    23362337
    23372338
    2338 tgb_sparse_matrix::tgb_sparse_matrix(int i, int j){
     2339tgb_sparse_matrix::tgb_sparse_matrix(int i, int j, ring rarg){
    23392340  mp=(mac_poly*) omalloc(i*sizeof (mac_poly));;
    23402341  int z;
     
    23472348  this->rows=i;
    23482349  free_numbers=FALSE;
     2350  r=rarg;
    23492351}
    23502352tgb_sparse_matrix::~tgb_sparse_matrix(){
     
    25032505  else
    25042506    return FALSE;
     2507}
     2508void tgb_sparse_matrix::row_normalize(int row){
     2509  if (!rField_has_simple_inverse(r))  /* Z/p, GF(p,n), R, long R/C */
     2510  {
     2511    mac_poly m=mp[row];
     2512        while (m!=NULL)
     2513        {
     2514          if (currRing==r) {nTest(m->coef);}
     2515          n_Normalize(m->coef,r);
     2516          m=m->next;
     2517        }
     2518  }
    25052519}
    25062520int tgb_sparse_matrix::non_zero_entries(int row){
     
    25672581}
    25682582
    2569 void simple_gauss(tgb_sparse_matrix* mat){
     2583void simple_gauss(tgb_sparse_matrix* mat, calc_dat* c){
    25702584  int col, row;
    25712585  int* row_cache=(int*) omalloc(mat->get_rows()*sizeof(int));
     
    26392653   
    26402654    found_in_row=row;
     2655    BOOLEAN must_reduce=FALSE;
    26412656    assume(pn<=mat->get_rows());
    26422657    for(i=row+1;i<=max_in_area;i++){
     
    26492664        col=first;
    26502665        found_in_row=i;
     2666        must_reduce=FALSE;
     2667      }
     2668      else {
     2669        if(first==col)
     2670          must_reduce=TRUE;
    26512671      }
    26522672    }
     
    26742694    row_cache[found_in_row]=h;
    26752695
     2696
     2697
     2698    if(!must_reduce){
     2699      row++;
     2700      continue;
     2701    }
    26762702    //reduction
     2703    //must extract content and normalize here
     2704    mat->row_normalize(row);
    26772705
    26782706    //for(i=row+1;i<pn;i++){
     
    26982726        mat->mult_row(i,n2);
    26992727        mat->add_lambda_times_row(i,row,n1);
     2728        nDelete(&n1);
     2729        nDelete(&n2);
    27002730        assume(mat->is_zero_entry(i,col));
    27012731        row_cache[i]=mat->min_col_not_zero_in_row(i);
     
    29212951}
    29222952static tgb_sparse_matrix* build_sparse_matrix(poly* p,int p_index,poly* done, int done_index, calc_dat* c){
    2923   tgb_sparse_matrix* t=new tgb_sparse_matrix(p_index,done_index);
     2953  tgb_sparse_matrix* t=new tgb_sparse_matrix(p_index,done_index,c->r);
    29242954  int i, pos;
    29252955  //  Print("\n 0:%s\n",pString(done[done_index-1]));
     
    34633493//   simple_gauss2(mat);
    34643494  tgb_sparse_matrix* mat=build_sparse_matrix(p,p_index,done, done_index,c);
    3465   simple_gauss(mat);
     3495  simple_gauss(mat,c);
    34663496  m_size=mat->get_rows();
    34673497  m=(poly*) omalloc(m_size*sizeof(poly));
     
    49624992    r[rn].flatten();
    49634993    kBucketClear(r[rn].bucket,&red,&red_len);
     4994    if (!rField_is_Zp(c->r))
     4995    {
     4996      pContent(red);
     4997      pCleardenom(red);//should be unnecessary
     4998     
     4999    }
     5000    pNormalize(red);
    49645001  }
    49655002  if (erg.to_reduce_u-erg.to_reduce_l>5){
  • Singular/tgb.h

    r2de2a9d r29d5f5  
    136136class tgb_sparse_matrix{
    137137 private:
     138  ring r;
    138139  mac_poly* mp;
    139140  int columns;
     
    144145  friend poly free_row_to_poly(tgb_sparse_matrix* mat, int row, poly* monoms, int monom_index);
    145146  friend void init_with_mac_poly(tgb_sparse_matrix* mat, int row, mac_poly m);
    146   tgb_sparse_matrix(int i, int j);
     147  tgb_sparse_matrix(int i, int j, ring rarg);
    147148  ~tgb_sparse_matrix();
    148149  int get_rows();
    149150  int get_columns();
    150151  void print();
     152  void row_normalize(int row);
    151153  //  void perm_rows(int i, int j);
    152154  void perm_rows(int i, int j){
Note: See TracChangeset for help on using the changeset viewer.