summaryrefslogtreecommitdiff
path: root/src/matrixOperations/transpose/stransposea.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/matrixOperations/transpose/stransposea.c')
-rw-r--r--src/matrixOperations/transpose/stransposea.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/matrixOperations/transpose/stransposea.c b/src/matrixOperations/transpose/stransposea.c
index 27f78835..219f2216 100644
--- a/src/matrixOperations/transpose/stransposea.c
+++ b/src/matrixOperations/transpose/stransposea.c
@@ -11,17 +11,16 @@
*/
#include "matrixTranspose.h"
-void stransposea ( float* in , int lines1 , int column1, float* out ){
+void stransposea ( float* in , int lines , int columns, float* out ){
+ int i = 0 ;
+ int j = 0 ;
- int newCoord = 0 ;
- int index = 0 ;
-
- for(index = 0 ; index < lines1 * column1 ; index++)
+ for(i = 0 ; i < lines ; i++)
{
- newCoord = index % column1 * lines1 + ( index / column1);
+ for(j = 0 ; j < columns ; j++)
- out[newCoord] = in[index];
+ out[j+i*columns] = in[i+j*lines];
}
}