Update of /cvsroot/pure-data/externals/iem/iem_matrix/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32571/iem/iem_matrix/src
Modified Files:
matrix_diag_mul_line8~.c matrix_diag_mul_line~.c
matrix_diag_mul_stat~.c
Log Message:
new date &
debugging of input buffering
Index: matrix_diag_mul_stat~.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iem_matrix/src/matrix_diag_mul_stat~.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** matrix_diag_mul_stat~.c 14 Dec 2006 20:09:35 -0000 1.2
--- matrix_diag_mul_stat~.c 22 Jun 2007 15:46:18 -0000 1.3
***************
*** 2,6 ****
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
! iem_matrix written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */
#include "m_pd.h"
--- 2,6 ----
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
! iem_matrix written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2007 */
#include "m_pd.h"
***************
*** 79,85 ****
t_float *mat = x->x_matbuf;
int n_io = x->x_n_io;
! int hn_io = n_io / 2;
! int dn_io = 2 * n_io;
! t_float *in, *out1, *out2, mul;
int i, j;
--- 79,83 ----
t_float *mat = x->x_matbuf;
int n_io = x->x_n_io;
! t_float *in, *out, mul;
int i, j;
***************
*** 89,111 ****
in = io[j];
for(i=0; i<n; i++)
! {
! in[i] *= mul;
! }
}
! for(j=0; j<hn_io; j++)
{
! in = io[j];
! for(i=0; i<n; i++)
! {
! buf[i] = in[i];
! }
! in = io[n_io-j-1];
! out1 = io[j+n_io];
! out2 = io[dn_io-j-1];
for(i=0; i<n; i++)
! {
! out1[i] = in[i];
! out2[i] = buf[i];
! }
}
return (w+3);
--- 87,99 ----
in = io[j];
for(i=0; i<n; i++)
! *buf++ = in[i] * mul;
}
!
! buf = x->x_buf;
! for(j=0; j<n_io; j++)
{
! out = io[j+n_io];
for(i=0; i<n; i++)
! out[i] = *buf++;
}
return (w+3);
***************
*** 117,126 ****
int n = (int)(w[2]);
t_float **io = x->x_io;
! t_float *buf;
t_float *mat = x->x_matbuf;
int n_io = x->x_n_io;
! int hn_io = n_io / 2;
! int dn_io = 2 * n_io;
! t_float *in, *out1, *out2, mul;
int i, j;
--- 105,112 ----
int n = (int)(w[2]);
t_float **io = x->x_io;
! t_float *buf = x->x_buf;
t_float *mat = x->x_matbuf;
int n_io = x->x_n_io;
! t_float *in, *out, mul;
int i, j;
***************
*** 129,181 ****
mul = mat[j];
in = io[j];
! for(i=n; i; i -= 8, in += 8)
{
! in[0] *= mul;
! in[1] *= mul;
! in[2] *= mul;
! in[3] *= mul;
! in[4] *= mul;
! in[5] *= mul;
! in[6] *= mul;
! in[7] *= mul;
}
}
! for(j=0; j<hn_io; j++)
{
! in = io[j];
! buf = x->x_buf;
! for(i=n; i; i -= 8, buf += 8, in += 8)
! {
! buf[0] = in[0];
! buf[1] = in[1];
! buf[2] = in[2];
! buf[3] = in[3];
! buf[4] = in[4];
! buf[5] = in[5];
! buf[6] = in[6];
! buf[7] = in[7];
! }
! in = io[n_io-j-1];
! out1 = io[j+n_io];
! out2 = io[dn_io-j-1];
! buf = x->x_buf;
! for(i=n; i; i -= 8, buf += 8, in += 8, out1 += 8, out2 += 8)
{
! out2[0] = in[0];
! out2[1] = in[1];
! out2[2] = in[2];
! out2[3] = in[3];
! out2[4] = in[4];
! out2[5] = in[5];
! out2[6] = in[6];
! out2[7] = in[7];
! out1[0] = buf[0];
! out1[1] = buf[1];
! out1[2] = buf[2];
! out1[3] = buf[3];
! out1[4] = buf[4];
! out1[5] = buf[5];
! out1[6] = buf[6];
! out1[7] = buf[7];
}
}
--- 115,145 ----
mul = mat[j];
in = io[j];
! for(i=n; i; i -= 8, in += 8, buf += 8)
{
! buf[0] = in[0] * mul;
! buf[1] = in[1] * mul;
! buf[2] = in[2] * mul;
! buf[3] = in[3] * mul;
! buf[4] = in[4] * mul;
! buf[5] = in[5] * mul;
! buf[6] = in[6] * mul;
! buf[7] = in[7] * mul;
}
}
!
! buf = x->x_buf;
! for(j=0; j<n_io; j++)
{
! out = io[j+n_io];
! for(i=n; i; i -= 8, buf += 8, out += 8)
{
! out[0] = buf[0];
! out[1] = buf[1];
! out[2] = buf[2];
! out[3] = buf[3];
! out[4] = buf[4];
! out[5] = buf[5];
! out[6] = buf[6];
! out[7] = buf[7];
}
}
***************
*** 186,199 ****
{
int i, n=sp[0]->s_n;
if(!x->x_buf)
{
! x->x_bufsize = n;
x->x_buf = (t_float *)getbytes(x->x_bufsize * sizeof(t_float));
}
! else if(x->x_bufsize != n)
{
! x->x_buf = (t_float *)resizebytes(x->x_buf, x->x_bufsize*sizeof(t_float), n*sizeof(t_float));
! x->x_bufsize = n;
}
--- 150,164 ----
{
int i, n=sp[0]->s_n;
+ int bufsize = sp[0]->s_n*x->x_n_io;
if(!x->x_buf)
{
! x->x_bufsize = bufsize;
x->x_buf = (t_float *)getbytes(x->x_bufsize * sizeof(t_float));
}
! else if(x->x_bufsize != bufsize)
{
! x->x_buf = (t_float *)resizebytes(x->x_buf, x->x_bufsize*sizeof(t_float), bufsize*sizeof(t_float));
! x->x_bufsize = bufsize;
}
***************
*** 202,206 ****
{
x->x_io[i] = sp[i]->s_vec;
! // post("iovec_addr = %d", (unsigned int)x->x_io[i]);
}
--- 167,171 ----
{
x->x_io[i] = sp[i]->s_vec;
! // post("iovec_addr = %d", (unsigned int)x->x_io[i]);
}
Index: matrix_diag_mul_line~.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iem_matrix/src/matrix_diag_mul_line~.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** matrix_diag_mul_line~.c 14 Dec 2006 20:09:35 -0000 1.2
--- matrix_diag_mul_line~.c 22 Jun 2007 15:46:18 -0000 1.3
***************
*** 2,6 ****
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
! iem_matrix written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */
#include "m_pd.h"
--- 2,6 ----
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
! iem_matrix written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2007 */
#include "m_pd.h"
***************
*** 160,170 ****
int n = (int)(w[2]);
t_float **io = x->x_io;
! t_float *buf;
t_float *matcur, *matend;
t_float *incp, *biginc, inc;
int n_io = x->x_n_io;
! int hn_io = n_io / 2;
! int dn_io = 2 * n_io;
! t_float *in, *out1, *out2, mul;
int i, j;
--- 160,168 ----
int n = (int)(w[2]);
t_float **io = x->x_io;
! t_float *buf=x->x_buf;
t_float *matcur, *matend;
t_float *incp, *biginc, inc;
int n_io = x->x_n_io;
! t_float *in, *out, mul;
int i, j;
***************
*** 207,227 ****
mul = matcur[j];
in = io[j];
! for(i=n; i; i -= 8, in += 8)
{
! in[0] *= mul;
mul += inc;
! in[1] *= mul;
mul += inc;
! in[2] *= mul;
mul += inc;
! in[3] *= mul;
mul += inc;
! in[4] *= mul;
mul += inc;
! in[5] *= mul;
mul += inc;
! in[6] *= mul;
mul += inc;
! in[7] *= mul;
mul += inc;
}
--- 205,225 ----
mul = matcur[j];
in = io[j];
! for(i=n; i; i -= 8, in += 8, buf += 8)
{
! buf[0] = in[0] * mul;
mul += inc;
! buf[1] = in[1] * mul;
mul += inc;
! buf[2] = in[2] * mul;
mul += inc;
! buf[3] = in[3] * mul;
mul += inc;
! buf[4] = in[4] * mul;
mul += inc;
! buf[5] = in[5] * mul;
mul += inc;
! buf[6] = in[6] * mul;
mul += inc;
! buf[7] = in[7] * mul;
mul += inc;
}
***************
*** 244,298 ****
mul = matend[j];
in = io[j];
! for(i=n; i; i -= 8, in += 8)
{
! in[0] *= mul;
! in[1] *= mul;
! in[2] *= mul;
! in[3] *= mul;
! in[4] *= mul;
! in[5] *= mul;
! in[6] *= mul;
! in[7] *= mul;
}
}
}
!
! for(j=0; j<hn_io; j++)
{
! in = io[j];
! buf = x->x_buf;
! for(i=n; i; i -= 8, buf += 8, in += 8)
! {
! buf[0] = in[0];
! buf[1] = in[1];
! buf[2] = in[2];
! buf[3] = in[3];
! buf[4] = in[4];
! buf[5] = in[5];
! buf[6] = in[6];
! buf[7] = in[7];
! }
! in = io[n_io-j-1];
! out1 = io[j+n_io];
! out2 = io[dn_io-j-1];
! buf = x->x_buf;
! for(i=n; i; i -= 8, buf += 8, in += 8, out1 += 8, out2 += 8)
{
! out2[0] = in[0];
! out2[1] = in[1];
! out2[2] = in[2];
! out2[3] = in[3];
! out2[4] = in[4];
! out2[5] = in[5];
! out2[6] = in[6];
! out2[7] = in[7];
! out1[0] = buf[0];
! out1[1] = buf[1];
! out1[2] = buf[2];
! out1[3] = buf[3];
! out1[4] = buf[4];
! out1[5] = buf[5];
! out1[6] = buf[6];
! out1[7] = buf[7];
}
}
--- 242,273 ----
mul = matend[j];
in = io[j];
! for(i=n; i; i -= 8, in += 8, buf += 8)
{
! buf[0] = in[0] * mul;
! buf[1] = in[1] * mul;
! buf[2] = in[2] * mul;
! buf[3] = in[3] * mul;
! buf[4] = in[4] * mul;
! buf[5] = in[5] * mul;
! buf[6] = in[6] * mul;
! buf[7] = in[7] * mul;
}
}
}
!
! buf = x->x_buf;
! for(j=0; j<n_io; j++)
{
! out = io[j+n_io];
! for(i=n; i; i -= 8, buf += 8, out += 8)
{
! out[0] = buf[0];
! out[1] = buf[1];
! out[2] = buf[2];
! out[3] = buf[3];
! out[4] = buf[4];
! out[5] = buf[5];
! out[6] = buf[6];
! out[7] = buf[7];
}
}
***************
*** 303,316 ****
{
int i, n=sp[0]->s_n;
if(!x->x_buf)
{
! x->x_bufsize = n;
x->x_buf = (t_float *)getbytes(x->x_bufsize * sizeof(t_float));
}
! else if(x->x_bufsize != n)
{
! x->x_buf = (t_float *)resizebytes(x->x_buf, x->x_bufsize*sizeof(t_float), n*sizeof(t_float));
! x->x_bufsize = n;
}
--- 278,292 ----
{
int i, n=sp[0]->s_n;
+ int bufsize = sp[0]->s_n*x->x_n_io;
if(!x->x_buf)
{
! x->x_bufsize = bufsize;
x->x_buf = (t_float *)getbytes(x->x_bufsize * sizeof(t_float));
}
! else if(x->x_bufsize != bufsize)
{
! x->x_buf = (t_float *)resizebytes(x->x_buf, x->x_bufsize*sizeof(t_float), bufsize*sizeof(t_float));
! x->x_bufsize = bufsize;
}
Index: matrix_diag_mul_line8~.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iem_matrix/src/matrix_diag_mul_line8~.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** matrix_diag_mul_line8~.c 14 Dec 2006 20:09:35 -0000 1.2
--- matrix_diag_mul_line8~.c 22 Jun 2007 15:46:18 -0000 1.3
***************
*** 2,6 ****
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
! iem_matrix written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */
#include "m_pd.h"
--- 2,6 ----
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
! iem_matrix written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2007 */
#include "m_pd.h"
***************
*** 161,171 ****
int n = (int)(w[2]);
t_float **io = x->x_io;
! t_float *buf;
t_float *matcur, *matend;
t_float *inc8, *biginc, inc;
int n_io = x->x_n_io;
! int hn_io = n_io / 2;
! int dn_io = 2 * n_io;
! t_float *in, *out1, *out2, mul;
int i, j;
--- 161,169 ----
int n = (int)(w[2]);
t_float **io = x->x_io;
! t_float *buf = x->x_buf;
t_float *matcur, *matend;
t_float *inc8, *biginc, inc;
int n_io = x->x_n_io;
! t_float *in, *out, mul;
int i, j;
***************
*** 208,221 ****
mul = matcur[j];
in = io[j];
! for(i=n; i; i -= 8, in += 8)
{
! in[0] *= mul;
! in[1] *= mul;
! in[2] *= mul;
! in[3] *= mul;
! in[4] *= mul;
! in[5] *= mul;
! in[6] *= mul;
! in[7] *= mul;
mul += inc;
}
--- 206,219 ----
mul = matcur[j];
in = io[j];
! for(i=n; i; i -= 8, in += 8, buf += 8)
{
! buf[0] = in[0] * mul;
! buf[1] = in[1] * mul;
! buf[2] = in[2] * mul;
! buf[3] = in[3] * mul;
! buf[4] = in[4] * mul;
! buf[5] = in[5] * mul;
! buf[6] = in[6] * mul;
! buf[7] = in[7] * mul;
mul += inc;
}
***************
*** 238,292 ****
mul = matend[j];
in = io[j];
! for(i=n; i; i -= 8, in += 8)
{
! in[0] *= mul;
! in[1] *= mul;
! in[2] *= mul;
! in[3] *= mul;
! in[4] *= mul;
! in[5] *= mul;
! in[6] *= mul;
! in[7] *= mul;
}
}
}
! for(j=0; j<hn_io; j++)
{
! in = io[j];
! buf = x->x_buf;
! for(i=n; i; i -= 8, buf += 8, in += 8)
! {
! buf[0] = in[0];
! buf[1] = in[1];
! buf[2] = in[2];
! buf[3] = in[3];
! buf[4] = in[4];
! buf[5] = in[5];
! buf[6] = in[6];
! buf[7] = in[7];
! }
! in = io[n_io-j-1];
! out1 = io[j+n_io];
! out2 = io[dn_io-j-1];
! buf = x->x_buf;
! for(i=n; i; i -= 8, buf += 8, in += 8, out1 += 8, out2 += 8)
{
! out2[0] = in[0];
! out2[1] = in[1];
! out2[2] = in[2];
! out2[3] = in[3];
! out2[4] = in[4];
! out2[5] = in[5];
! out2[6] = in[6];
! out2[7] = in[7];
! out1[0] = buf[0];
! out1[1] = buf[1];
! out1[2] = buf[2];
! out1[3] = buf[3];
! out1[4] = buf[4];
! out1[5] = buf[5];
! out1[6] = buf[6];
! out1[7] = buf[7];
}
}
--- 236,267 ----
mul = matend[j];
in = io[j];
! for(i=n; i; i -= 8, in += 8, buf += 8)
{
! buf[0] = in[0] * mul;
! buf[1] = in[1] * mul;
! buf[2] = in[2] * mul;
! buf[3] = in[3] * mul;
! buf[4] = in[4] * mul;
! buf[5] = in[5] * mul;
! buf[6] = in[6] * mul;
! buf[7] = in[7] * mul;
}
}
}
! buf = x->x_buf;
! for(j=0; j<n_io; j++)
{
! out = io[j+n_io];
! for(i=n; i; i -= 8, buf += 8, out += 8)
{
! out[0] = buf[0];
! out[1] = buf[1];
! out[2] = buf[2];
! out[3] = buf[3];
! out[4] = buf[4];
! out[5] = buf[5];
! out[6] = buf[6];
! out[7] = buf[7];
}
}
***************
*** 297,310 ****
{
int i, n=sp[0]->s_n;
if(!x->x_buf)
{
! x->x_bufsize = n;
x->x_buf = (t_float *)getbytes(x->x_bufsize * sizeof(t_float));
}
! else if(x->x_bufsize != n)
{
! x->x_buf = (t_float *)resizebytes(x->x_buf, x->x_bufsize*sizeof(t_float), n*sizeof(t_float));
! x->x_bufsize = n;
}
--- 272,286 ----
{
int i, n=sp[0]->s_n;
+ int bufsize = sp[0]->s_n*x->x_n_io;
if(!x->x_buf)
{
! x->x_bufsize = bufsize;
x->x_buf = (t_float *)getbytes(x->x_bufsize * sizeof(t_float));
}
! else if(x->x_bufsize != bufsize)
{
! x->x_buf = (t_float *)resizebytes(x->x_buf, x->x_bufsize*sizeof(t_float), bufsize*sizeof(t_float));
! x->x_bufsize = bufsize;
}