diff options
author | jofret | 2008-12-03 09:54:13 +0000 |
---|---|---|
committer | jofret | 2008-12-03 09:54:13 +0000 |
commit | 0adeb202d7d434a74a2e884b529cb758bd1a83ca (patch) | |
tree | c8319f3ebddbf1b754d99a1171a8076470781371 /src/matrixOperations/inversion/sinverma.c | |
parent | 7950bb92612464429ceb4ff63e2d2f6fd555498e (diff) | |
download | scilab2c-0adeb202d7d434a74a2e884b529cb758bd1a83ca.tar.gz scilab2c-0adeb202d7d434a74a2e884b529cb758bd1a83ca.tar.bz2 scilab2c-0adeb202d7d434a74a2e884b529cb758bd1a83ca.zip |
Adding stdlib
Diffstat (limited to 'src/matrixOperations/inversion/sinverma.c')
-rw-r--r-- | src/matrixOperations/inversion/sinverma.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/matrixOperations/inversion/sinverma.c b/src/matrixOperations/inversion/sinverma.c index 30f8173e..f02a0e8b 100644 --- a/src/matrixOperations/inversion/sinverma.c +++ b/src/matrixOperations/inversion/sinverma.c @@ -11,45 +11,45 @@ */ - -#include "matrixInversion.h" -#include "lapack.h" #include <stdio.h> +#include <stdlib.h> +#include "matrixInversion.h" +#include "lapack.h" void sinverma ( float* in, float* out, int leadDimIn ) { int i = 0 ; - /* these 3 variable are created to permit to use the value in the fortran functions + /* these 3 variable are created to permit to use the value in the fortran functions because they need double matrix as arguments and we can't cast directly the pointers without having problems , i know that's ugly */ double *dblin = NULL; - double *dblout = NULL; + double *dblout = NULL; + + - - /* Array allocations*/ - dblin = (double*)malloc(sizeof(double) * (unsigned int)(leadDimIn * leadDimIn)); + dblin = (double*)malloc(sizeof(double) * (unsigned int)(leadDimIn * leadDimIn)); dblout = (double*)malloc(sizeof(double) * (unsigned int)(leadDimIn * leadDimIn)); - /*copy and cast all the float value into double value */ + /*copy and cast all the float value into double value */ for ( i = 0 ; i < (leadDimIn * leadDimIn) ; i ++ ) - { + { dblin[i] = (double) in[i] ; } - + dinverma ( dblin, dblout, leadDimIn ); - + for ( i = 0 ; i < (leadDimIn * leadDimIn) ; i++ ) { out[i] =(float) dblout[i] ; - } + } free ( dblin); - free ( dblout); + free ( dblout); } |