path: root/src/mtx_transpose.c
diff options
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-05-11 13:05:29 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-05-11 13:05:29 +0000
commitc74f9041a42d95190b88990e91c2587f2f57a056 (patch)
tree5679242a76c8f8a0fc59fcc044c97c01b6713471 /src/mtx_transpose.c
parentf4299cb7e6a5e161aa16670acd33de1ef75fae4d (diff)
split the objects from mtx_binops into several files: mtx_add, mtx_sub, mtx_mul, mtx_pow
mtx_binops is still there for glue functions exposed some important operations on float-arrays via iemmatrix.h (mtx_doInvert, mtx_doTranspose, mtx_doMultiply) as you can easily see, they all start with "mtx_do" and a capital letter; they all return a pointer to (newly allocated) memory with the result svn path=/trunk/externals/iem/iemmatrix/; revision=2947
Diffstat (limited to 'src/mtx_transpose.c')
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++);