[BACK]Return to nd.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / engine

Diff for /OpenXM_contrib2/asir2000/engine/nd.c between version 1.215 and 1.217

version 1.215, 2013/12/20 02:02:24 version 1.217, 2014/02/03 02:43:05
Line 1 
Line 1 
 /* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.214 2013/09/27 07:00:45 noro Exp $ */  /* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.216 2013/12/20 04:35:34 noro Exp $ */
   
 #include "nd.h"  #include "nd.h"
   
Line 2703  int ndv_newps(int m,NDV a,NDV aq,int f4)
Line 2703  int ndv_newps(int m,NDV a,NDV aq,int f4)
     nd_ps[nd_psn] = a;      nd_ps[nd_psn] = a;
     if ( aq ) {      if ( aq ) {
         nd_ps_trace[nd_psn] = aq;          nd_ps_trace[nd_psn] = aq;
                 nd_ps_gz[nd_psn] = ndvtondvgz(aq);                  if ( !nd_vc ) nd_ps_gz[nd_psn] = ndvtondvgz(aq);
         register_hcf(aq);          register_hcf(aq);
         nd_bound[nd_psn] = ndv_compute_bound(aq);          nd_bound[nd_psn] = ndv_compute_bound(aq);
         SG(r) = SG(aq); ndl_copy(HDL(aq),DL(r));          SG(r) = SG(aq); ndl_copy(HDL(aq),DL(r));
Line 2711  int ndv_newps(int m,NDV a,NDV aq,int f4)
Line 2711  int ndv_newps(int m,NDV a,NDV aq,int f4)
         if ( !m ) register_hcf(a);          if ( !m ) register_hcf(a);
         nd_bound[nd_psn] = ndv_compute_bound(a);          nd_bound[nd_psn] = ndv_compute_bound(a);
         SG(r) = SG(a); ndl_copy(HDL(a),DL(r));          SG(r) = SG(a); ndl_copy(HDL(a),DL(r));
                 if ( !m ) nd_ps_gz[nd_psn] = ndvtondvgz(a);                  if ( !m && !nd_vc ) nd_ps_gz[nd_psn] = ndvtondvgz(a);
     }      }
     if ( nd_demand ) {      if ( nd_demand ) {
         if ( aq ) {          if ( aq ) {
Line 2789  int ndv_setup(int mod,int trace,NODE f,int dont_sort,i
Line 2789  int ndv_setup(int mod,int trace,NODE f,int dont_sort,i
         hc = HCU(w[i].p);          hc = HCU(w[i].p);
         if ( trace ) {          if ( trace ) {
             a = nd_ps_trace[i] = ndv_dup(0,w[i].p);              a = nd_ps_trace[i] = ndv_dup(0,w[i].p);
                         nd_ps_gz[i] = ndvtondvgz(a);                          if ( !nd_vc ) nd_ps_gz[i] = ndvtondvgz(a);
             if ( !dont_removecont) ndv_removecont(0,a);              if ( !dont_removecont) ndv_removecont(0,a);
             register_hcf(a);              register_hcf(a);
             am = nd_ps[i] = ndv_dup(mod,a);              am = nd_ps[i] = ndv_dup(mod,a);
Line 2799  int ndv_setup(int mod,int trace,NODE f,int dont_sort,i
Line 2799  int ndv_setup(int mod,int trace,NODE f,int dont_sort,i
             ndv_removecont(mod,am);              ndv_removecont(mod,am);
         } else {          } else {
             a = nd_ps[i] = ndv_dup(mod,w[i].p);              a = nd_ps[i] = ndv_dup(mod,w[i].p);
                         if ( !mod ) nd_ps_gz[i] = ndvtondvgz(a);                          if ( !mod && !nd_vc ) nd_ps_gz[i] = ndvtondvgz(a);
             if ( mod || !dont_removecont ) ndv_removecont(mod,a);              if ( mod || !dont_removecont ) ndv_removecont(mod,a);
             if ( !mod ) register_hcf(a);              if ( !mod ) register_hcf(a);
         }          }
Line 6978  int nd_gauss_elim_gz(GZ **mat0,int *sugar,int row,int 
Line 6978  int nd_gauss_elim_gz(GZ **mat0,int *sugar,int row,int 
 {  {
     int i,j,t,c,rank,inv;      int i,j,t,c,rank,inv;
     int *ci,*ri;      int *ci,*ri;
     GZ *dn;      GZ dn;
     MAT m,nm;      MAT m,nm;
   
     NEWMAT(m); m->row = row; m->col = col; m->body = (pointer **)mat0;      NEWMAT(m); m->row = row; m->col = col; m->body = (pointer **)mat0;
         dn = (GZ *)MALLOC(row*sizeof(GZ));      rank = gz_generic_gauss_elim(m,&nm,&dn,&ri,&ci);
     rank = gz_generic_gauss_elim2(m,&nm,dn,&ri,&ci);  
     for ( i = 0; i < row; i++ )      for ( i = 0; i < row; i++ )
         for ( j = 0; j < col; j++ )          for ( j = 0; j < col; j++ )
             mat0[i][j] = 0;              mat0[i][j] = 0;
     c = col-rank;      c = col-rank;
     for ( i = 0; i < rank; i++ ) {      for ( i = 0; i < rank; i++ ) {
         mat0[i][ri[i]] = dn[i];          mat0[i][ri[i]] = dn;
         for ( j = 0; j < c; j++ )          for ( j = 0; j < c; j++ )
             mat0[i][ci[j]] = (GZ)BDY(nm)[i][j];              mat0[i][ci[j]] = (GZ)BDY(nm)[i][j];
     }      }

Legend:
Removed from v.1.215  
changed lines
  Added in v.1.217

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>