diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2008-01-03 12:28:27 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2008-01-03 12:28:27 +0000 |
commit | c3a067dc355fc57a5759d4e9a97bcbcd878caf13 (patch) | |
tree | 2035f23ed32392b7d7b92baf9fac1d4dc23e4cac /src/mtx_gauss.c | |
parent | 205992dca4afb92591c09353373244ce14204b52 (diff) |
pedantic and C99
svn path=/trunk/externals/iem/iemmatrix/; revision=9114
Diffstat (limited to 'src/mtx_gauss.c')
-rw-r--r-- | src/mtx_gauss.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/mtx_gauss.c b/src/mtx_gauss.c index 8d64cf6..139ea0f 100644 --- a/src/mtx_gauss.c +++ b/src/mtx_gauss.c @@ -45,7 +45,7 @@ static void mtx_gauss_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv) const t_matrixfloat singrange = 1.0e-10; t_matrixfloat *original; - t_matrixfloat *a1, *a2; // dummy pointers + t_matrixfloat *a1, *a2; /* dummy pointers */ if(row*col+2>argc){ @@ -57,11 +57,11 @@ static void mtx_gauss_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv) return; } - // reserve memory for outputting afterwards + /* reserve memory for outputting afterwards */ adjustsize(x, row, row); original=matrix2float(argv); - // Gauss elimination + /* Gauss elimination */ for(i=0; i<row; i++) { int nz = 0; a1=original+i*(col+1); @@ -73,29 +73,28 @@ static void mtx_gauss_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv) } a1+=col; } - //if(nz) + /*if(nz)*/ { - // exchange rows "nz" and "i" + /* exchange rows "nz" and "i" */ if(nz != i)mtx_gauss_xch(original+i*col+i, original+nz*col+i, col-i); - // for(j=i+1; j<row; j++){ - t_matrixfloat f=0.; - a1=original+i*(col+1); - a2=original+j*col+i; - if(*a2){ - f=*a1 / *a2; - mtx_gauss_mulsub(a1, a2, col-i, f); - } + t_matrixfloat f=0.; + a1=original+i*(col+1); + a2=original+j*col+i; + if(*a2){ + f=*a1 / *a2; + mtx_gauss_mulsub(a1, a2, col-i, f); + } } } } - // 3. output the matrix - // 3a convert the floatbuf to an atombuf; + /* 3. output the matrix */ + /* 3a convert the floatbuf to an atombuf; */ float2matrix(x->atombuffer, original); - // 3c output the atombuf; + /* 3c output the atombuf; */ matrix_bang(x); } |