diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mtx_diegg.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mtx_diegg.c b/src/mtx_diegg.c index 394a3b6..0c17294 100644 --- a/src/mtx_diegg.c +++ b/src/mtx_diegg.c @@ -21,7 +21,10 @@ static void mtx_diegg_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv) t_atom *ap = (t_atom *)getbytes(length * sizeof(t_atom)), *dummy=ap; if(row*col>argc-2)post("mtx_diegg: sparse matrices not yet supported : use \"mtx_check\""); else { - for(n=0;n<length;n++, dummy++)SETFLOAT(dummy, atom_getfloat(argv+(n-1)*(col-1))); + for(n=0;n<length;n++, dummy++){ + int index=(n+1)*(col-1); + SETFLOAT(dummy, atom_getfloat(argv+index)); + } outlet_list(x->x_obj.ob_outlet, gensym("diegg"), length, ap); } freebytes(ap, (length * sizeof(t_atom))); @@ -34,11 +37,8 @@ static void *mtx_diegg_new(t_symbol *s, int argc, t_atom *argv) x->atombuffer = 0; if(!argc)return(x); - x->atombuffer = (t_atom *)getbytes((argc*argc+2)*sizeof(t_atom)); - setdimen(x, argc, argc); - matrix_set(x, 0); - argv+=argc-1; - while(argc--)SETFLOAT(x->atombuffer+2+argc*(1+x->col), atom_getfloat(argv--)); + + matrix_diegg(x, s, argc, argv); return (x); } |