diff options
Diffstat (limited to 'src/mtx_transpose.c')
-rw-r--r-- | src/mtx_transpose.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mtx_transpose.c b/src/mtx_transpose.c index 5e0771c..1fe2eab 100644 --- a/src/mtx_transpose.c +++ b/src/mtx_transpose.c @@ -16,6 +16,18 @@ /* mtx_transpose */ static t_class *mtx_transpose_class; +t_matrixfloat*mtx_doTranspose(t_matrixfloat*transposee, int row, int col){ + int r,c; + t_matrixfloat*transposed=(t_matrixfloat*)getbytes(sizeof(t_matrixfloat)*row*col); + r=row; + while(r--){ + c=col; + while(c--) + transposed[c*row+r]=transposee[r*col+c]; + } + return transposed; +} + static void mtx_transpose_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv) { int row=atom_getfloat(argv++); |