diff options
Diffstat (limited to '2.3-1/src/c/matrixOperations')
24 files changed, 819 insertions, 1 deletions
diff --git a/2.3-1/src/c/matrixOperations/eye/i16eyea.c b/2.3-1/src/c/matrixOperations/eye/i16eyea.c new file mode 100644 index 00000000..90d7fe7a --- /dev/null +++ b/2.3-1/src/c/matrixOperations/eye/i16eyea.c @@ -0,0 +1,23 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "eye.h" + +void i16eyea(int16* in, int _iRows, int _iCols) +{ + int i, j ; + + for ( i = 0 ; i < _iCols ; i++ ) + for ( j = 0 ; j < _iRows ; j++ ) + in[i*_iRows + j] = (i == j)?(int16)1:(int16)0 ; +} + diff --git a/2.3-1/src/c/matrixOperations/eye/i8eyea.c b/2.3-1/src/c/matrixOperations/eye/i8eyea.c new file mode 100644 index 00000000..e2fecca6 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/eye/i8eyea.c @@ -0,0 +1,23 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "eye.h" + +void i8eyea(int8* in, int _iRows, int _iCols) +{ + int i, j ; + + for ( i = 0 ; i < _iCols ; i++ ) + for ( j = 0 ; j < _iRows ; j++ ) + in[i*_iRows + j] = (i == j)?(int8)1:(int8)0 ; +} + diff --git a/2.3-1/src/c/matrixOperations/eye/u16eyea.c b/2.3-1/src/c/matrixOperations/eye/u16eyea.c new file mode 100644 index 00000000..63c479fd --- /dev/null +++ b/2.3-1/src/c/matrixOperations/eye/u16eyea.c @@ -0,0 +1,23 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "eye.h" + +void u16eyea(uint16* in, int _iRows, int _iCols) +{ + int i, j ; + + for ( i = 0 ; i < _iCols ; i++ ) + for ( j = 0 ; j < _iRows ; j++ ) + in[i*_iRows + j] = (i == j)?(uint16)1:(uint16)0 ; +} + diff --git a/2.3-1/src/c/matrixOperations/eye/u8eyea.c b/2.3-1/src/c/matrixOperations/eye/u8eyea.c new file mode 100644 index 00000000..8278303d --- /dev/null +++ b/2.3-1/src/c/matrixOperations/eye/u8eyea.c @@ -0,0 +1,23 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "eye.h" + +void u8eyea(uint8* in, int _iRows, int _iCols) +{ + int i, j ; + + for ( i = 0 ; i < _iCols ; i++ ) + for ( j = 0 ; j < _iRows ; j++ ) + in[i*_iRows + j] = (i == j)?(uint8)1:(uint8)0 ; +} + diff --git a/2.3-1/src/c/matrixOperations/includes/eye.h b/2.3-1/src/c/matrixOperations/includes/eye.h index f7f2ef2f..95bdd797 100644 --- a/2.3-1/src/c/matrixOperations/includes/eye.h +++ b/2.3-1/src/c/matrixOperations/includes/eye.h @@ -16,6 +16,7 @@ #include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "ones.h" #ifdef __cplusplus extern "C" { @@ -42,6 +43,26 @@ extern "C" { #define zeyes(in) DoubleComplex(1, 0) /* +** \brief create a Uint8 Eye value +*/ +#define u8eyes(in) (uint8)1 + +/* +** \brief create a int8 Eye value +*/ +#define i8eyes(in) (int8)1 + +/* +** \brief create a Uint16 Eye value +*/ +#define u16eyes(in) (uint16)1 + +/* +** \brief create a int16 Eye value +*/ +#define i16eyes(in) (int16)1 + +/* ** \brief create a float Eye matrix */ EXTERN_MATOPS void seyea(float* in, int _iRows, int _iCols); @@ -61,6 +82,26 @@ EXTERN_MATOPS void ceyea(floatComplex* in, int _iRows, int _iCols); */ EXTERN_MATOPS void zeyea(doubleComplex* in, int _iRows, int _iCols); +/* +** \brief create a uint8 Eye matrix +*/ +EXTERN_MATOPS void u8eyea(uint8* in, int _iRows, int _iCols); + +/* +** \brief create a int8 Eye matrix +*/ +EXTERN_MATOPS void i8eyea(int8* in, int _iRows, int _iCols); + +/* +** \brief create a uint16 Eye matrix +*/ +EXTERN_MATOPS void u16eyea(uint16* in, int _iRows, int _iCols); + +/* +** \brief create a int16 Eye matrix +*/ +EXTERN_MATOPS void i16eyea(int16* in, int _iRows, int _iCols); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/2.3-1/src/c/matrixOperations/includes/matrixInversion.h b/2.3-1/src/c/matrixOperations/includes/matrixInversion.h index 90312459..e547bb97 100644 --- a/2.3-1/src/c/matrixOperations/includes/matrixInversion.h +++ b/2.3-1/src/c/matrixOperations/includes/matrixInversion.h @@ -16,6 +16,7 @@ #include "abs.h" #include "dynlib_matrixoperations.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -59,6 +60,43 @@ EXTERN_MATOPS void cinverma ( floatComplex* in, floatComplex* out, int leadDimIn EXTERN_MATOPS void zinverma ( doubleComplex* in, doubleComplex* out, int leadDimIn ); +/* +** \brief Compute the matrix inverse for uint8. +** \param in : input matrix. +** \param leadDimIn : the leading dimension of the matrix . +** \param out : the matrix inverse of the input . +*/ + +EXTERN_MATOPS void u8inverma ( uint8* in, float* out, int leadDimIn ); + +/* +** \brief Compute the matrix inverse for int8. +** \param in : input matrix. +** \param leadDimIn : the leading dimension of the matrix . +** \param out : the matrix inverse of the input . +*/ + +EXTERN_MATOPS void i8inverma ( int8* in, float* out, int leadDimIn ); + +/* +** \brief Compute the matrix inverse for uint16. +** \param in : input matrix. +** \param leadDimIn : the leading dimension of the matrix . +** \param out : the matrix inverse of the input . +*/ + +EXTERN_MATOPS void u16inverma ( uint16* in, float* out, int leadDimIn ); + +/* +** \brief Compute the matrix inverse for int16. +** \param in : input matrix. +** \param leadDimIn : the leading dimension of the matrix . +** \param out : the matrix inverse of the input . +*/ + +EXTERN_MATOPS void i16inverma ( int16* in, float* out, int leadDimIn ); + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/2.3-1/src/c/matrixOperations/includes/ones.h b/2.3-1/src/c/matrixOperations/includes/ones.h index 63d8bd4b..6734017d 100644 --- a/2.3-1/src/c/matrixOperations/includes/ones.h +++ b/2.3-1/src/c/matrixOperations/includes/ones.h @@ -17,6 +17,7 @@ #include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus @@ -43,25 +44,67 @@ extern "C" { */ #define zoness(in) DoubleComplex(1, 0) +/* +** \brief create a uint8 one value +*/ +#define u8oness(in) (uint8)1 + +/* +** \brief create a int8 one value +*/ +#define i8oness(in) (int8)1 + +/* +** \brief create a uint16 one value +*/ +#define u16oness(in) (uint16)1 + +/* +** \brief create a int16 one value +*/ +#define i16oness(in) (int16)1 /* ** \brief create a float matrix full of one */ EXTERN_MATOPS void sonesa ( float* in , int rows , int cols ); + /* ** \brief create a float complex matrix full of one */ EXTERN_MATOPS void conesa ( floatComplex* in , int rows ,int cols ); + /* ** \brief create a double matrix full of one */ EXTERN_MATOPS void donesa ( double* in , int rows ,int cols ); + /* ** \brief create a double complex matrix full of one */ EXTERN_MATOPS void zonesa ( doubleComplex* in , int rows ,int cols ); +/* +** \brief create a uint8 matrix full of one +*/ +EXTERN_MATOPS void u8onesa ( uint8* in , int rows , int cols ); + +/* +** \brief create a int8 matrix full of one +*/ +EXTERN_MATOPS void i8onesa ( int8* in , int rows , int cols ); + +/* +** \brief create a uint16 matrix full of one +*/ +EXTERN_MATOPS void u16onesa ( uint16* in , int rows , int cols ); + +/* +** \brief create a int16 matrix full of one +*/ +EXTERN_MATOPS void i16onesa ( int16* in , int rows , int cols ); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/2.3-1/src/c/matrixOperations/includes/zeros.h b/2.3-1/src/c/matrixOperations/includes/zeros.h index 06b2e5a5..993940fc 100644 --- a/2.3-1/src/c/matrixOperations/includes/zeros.h +++ b/2.3-1/src/c/matrixOperations/includes/zeros.h @@ -17,6 +17,7 @@ #include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -43,6 +44,25 @@ extern "C" { #define zzeross(in) DoubleComplex(0, 0) +/* +** \brief create a single uint8 zero +*/ +#define u8zerosu8(in) (uint8)0 + +/* +** \brief create a single int8 zero +*/ +#define i8zerosi8(in) (int8)0 + +/* +** \brief create a single uint8 zero +*/ +#define u16zerosu16(in) (uint16)0 + +/* +** \brief create a single int8 zero +*/ +#define i16zerosi16(in) (int16)0 /* ** \brief create a float matrix full of one @@ -66,6 +86,26 @@ EXTERN_MATOPS void zzerosa ( doubleComplex* in , int rows ,int cols ); */ EXTERN_MATOPS void dzerosh ( double* in , int rows ,int cols , int levels); +/* +** \brief create a uint8 matrix full of zero +*/ +EXTERN_MATOPS void u8zerosa ( uint8* in , int rows , int cols ); + +/* +** \brief create a int8 matrix full of zero +*/ +EXTERN_MATOPS void i8zerosa ( int8* in , int rows , int cols ); + +/* +** \brief create a uint16 matrix full of zero +*/ +EXTERN_MATOPS void u16zerosa ( uint16* in , int rows , int cols ); + +/* +** \brief create a int16 matrix full of zero +*/ +EXTERN_MATOPS void i16zerosa ( int16* in , int rows , int cols ); + #ifdef __cplusplus } /* extern "C" */ diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_eye.h b/2.3-1/src/c/matrixOperations/interfaces/int_eye.h index 81ed7fdd..1e10eb83 100644 --- a/2.3-1/src/c/matrixOperations/interfaces/int_eye.h +++ b/2.3-1/src/c/matrixOperations/interfaces/int_eye.h @@ -20,7 +20,13 @@ #define eyed0() 1 +#define eyeu80() (uint8)1 +#define eyei80() (int8)1 + +#define eyeu160() (uint16)1 + +#define eyei160() (int16)1 #define s0eyes0(in) seyes(in) @@ -30,16 +36,37 @@ #define z0eyez0(in) zeyes(in) +#define u80eyeu80(in) u8eyes(in) + +#define i80eyei80(in) i8eyes(in) + +#define u160eyeu160(in) u16eyes(in) + +#define i160eyei160(in) i16eyes(in) #define s0s0eyes0(in1,in2) 1.0f #define d0d0eyed0(in,in2) 1 +#define u80u80eyeu80(in1,in2) (uint8)1 + +#define i80i80eyei80(in1,in2) (int8)1 + +#define u160u160eyeu160(in1,in2) (uint16)1 + +#define i160i160eyei160(in1,in2) (int16)1 #define s0s0eyes2(in1,in2,out) seyea(out, in1, in2) #define d0d0eyed2(in1,in2,out) deyea(out, in1, in2) +#define u80u80eyeu82(in1,in2,out) u8eyea(out, in1, in2) + +#define i80i80eyei82(in1,in2,out) i8eyea(out, in1, in2) + +#define u160u160eyeu162(in1,in2,out) u16eyea(out, in1, in2) + +#define i160i160eyei162(in1,in2,out) i16eyea(out, in1, in2) #define s2eyes2(in,size,out) seyea(out, size[0], size[1]) @@ -49,5 +76,13 @@ #define z2eyez2(in,size,out) zeyea(out, size[0], size[1]) +#define u82eyeu82(in,size,out) u8eyea(out, size[0], size[1]) + +#define i82eyei82(in,size,out) i8eyea(out, size[0], size[1]) + +#define u162eyeu162(in,size,out) u16eyea(out, size[0], size[1]) + +#define i162eyei162(in,size,out) i16eyea(out, size[0], size[1]) + #endif /* !__INT_EYE_H__ */ diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_invert.h b/2.3-1/src/c/matrixOperations/interfaces/int_invert.h index d31481b6..285a0f4a 100644 --- a/2.3-1/src/c/matrixOperations/interfaces/int_invert.h +++ b/2.3-1/src/c/matrixOperations/interfaces/int_invert.h @@ -23,6 +23,14 @@ #define z0invz0(in) zrdivs(DoubleComplex(1,0),in) +#define u80invs0(in) 1.0f/(float)in + +#define i80invs0(in) 1.0f/(float)in + +#define u160invs0(in) 1.0f/(float)in + +#define i160invs0(in) 1.0f/(float)in + #define s2invs2(in,size,out) sinverma(in, out, size[0]) #define d2invd2(in,size,out) dinverma(in, out, size[0]) @@ -31,4 +39,12 @@ #define z2invz2(in,size,out) zinverma(in, out, size[0]) +#define u82invs2(in,size,out) u8inverma(in, out, size[0]) + +#define i82invs2(in,size,out) i8inverma(in, out, size[0]) + +#define u162invs2(in,size,out) u16inverma(in, out, size[0]) + +#define i162invs2(in,size,out) i16inverma(in, out, size[0]) + #endif /* !__INT_INV_H__ */ diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_ones.h b/2.3-1/src/c/matrixOperations/interfaces/int_ones.h index 0259b4c6..3946a487 100644 --- a/2.3-1/src/c/matrixOperations/interfaces/int_ones.h +++ b/2.3-1/src/c/matrixOperations/interfaces/int_ones.h @@ -20,7 +20,13 @@ #define onesd0() 1 +#define onesu80() (uint8)1 +#define onesi80() (int8)1 + +#define onesu160() (uint16)1 + +#define onesi160() (int16)1 #define s0oness0(in) soness(in) @@ -30,16 +36,37 @@ #define z0onesz0(in) zoness(in) +#define u80onesu80(in) u8oness(in) + +#define i80onesi80(in) i8oness(in) + +#define u160onesu160(in) u16oness(in) + +#define i160onesi160(in) i16oness(in) #define s0s0oness0(in1,in2) 1.0f #define d0d0onesd0(in,in2) 1 +#define u80u80onesu80(in1,in2) (uint8)1 + +#define i80i80onesi80(in1,in2) (int8)1 + +#define u160u160onesu160(in1,in2) (uint16)1 + +#define i160i160onesi160(in1,in2) (int16)1 #define s0s0oness2(in1,in2,out) sonesa(out, in1, in2) #define d0d0onesd2(in1,in2,out) donesa(out, in1, in2) +#define u80u80onesu82(in1,in2,out) u8onesa(out, in1, in2) + +#define i80i80onesi82(in1,in2,out) i8onesa(out, in1, in2) + +#define u160u160onesu82(in1,in2,out) u16onesa(out, in1, in2) + +#define i160i160onesi162(in1,in2,out) i16onesa(out, in1, in2) #define s2oness2(in,size,out) sonesa(out, size[0], size[1]) @@ -49,5 +76,12 @@ #define z2onesz2(in,size,out) zonesa(out, size[0], size[1]) +#define u82onesu82(in,size,out) u8onesa(out, size[0], size[1]) + +#define i82onesi82(in,size,out) i8onesa(out, size[0], size[1]) + +#define u162onesu162(in,size,out) u16onesa(out, size[0], size[1]) + +#define i162onesi162(in,size,out) i16onesa(out, size[0], size[1]) #endif /* !__INT_ONES_H__ */ diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_zeros.h b/2.3-1/src/c/matrixOperations/interfaces/int_zeros.h index 4bc32138..0f97af04 100644 --- a/2.3-1/src/c/matrixOperations/interfaces/int_zeros.h +++ b/2.3-1/src/c/matrixOperations/interfaces/int_zeros.h @@ -21,7 +21,13 @@ #define zerosd0() 0 +#define zerosu80() (uint8)0 +#define zerosi80() (int8)0 + +#define zerosu160() (uint16)0 + +#define zerosi160() (int16)0 #define s0zeross0(in) szeross(in) @@ -31,16 +37,37 @@ #define z0zerosz0(in) zzeross(in) +#define u80zerosu80(in) u8zeross(in) + +#define i80zerosi80(in) i8zeross(in) + +#define u160zerosu160(in) u16zeross(in) + +#define i160zerosi160(in) i16zeross(in) #define s0s0zeross0(in1,in2) 0.0f -#define d0d0zerosd0(in,in2) 0 +#define d0d0zerosd0(in1,in2) 0 + +#define u80u80zerosu80(in1,in2) (uint8)0 + +#define i80i80zerosi80(in1,in2) (int8)0 + +#define u160u160zerosu160(in1,in2) (uint16)0 +#define i160i160zerosi160(in1,in2) (int16)0 #define s0s0zeross2(in1,in2,out) szerosa(out, in1, in2) #define d0d0zerosd2(in1,in2,out) dzerosa(out, in1, in2) +#define u80u80zeross2(in1,in2,out) u80zerosa(out, in1, in2) + +#define i80i80zeross2(in1,in2,out) i80zerosa(out, in1, in2) + +#define u160u160zeross2(in1,in2,out) u160zerosa(out, in1, in2) + +#define i160i160zeross2(in1,in2,out) i160zerosa(out, in1, in2) #define s2zeross2(in,size,out) szerosa(out, size[0], size[1]) @@ -50,5 +77,13 @@ #define z2zerosz2(in,size,out) zzerosa(out, size[0], size[1]) +#define u82zerosu82(in,size,out) u8zerosa(out, size[0], size[1]) + +#define i82zerosi82(in,size,out) i8zerosa(out, size[0], size[1]) + +#define u162zerosu162(in,size,out) u16zerosa(out, size[0], size[1]) + +#define i162zerosi162(in,size,out) i16zerosa(out, size[0], size[1]) + #define d0d0d0zerosd3(in1, in2, in3, out) dzerosh(out, in1, in2, in3); #endif /* !__INT_ZEROS_H__ */ diff --git a/2.3-1/src/c/matrixOperations/inversion/i16inverma.c b/2.3-1/src/c/matrixOperations/inversion/i16inverma.c new file mode 100644 index 00000000..a6b1c08f --- /dev/null +++ b/2.3-1/src/c/matrixOperations/inversion/i16inverma.c @@ -0,0 +1,55 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include <stdio.h> +#include <stdlib.h> +#include "matrixInversion.h" +#include "lapack.h" + +void i16inverma ( int16* in, float* out, int leadDimIn ) +{ + + int i = 0 ; + /* 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; + + + + /* Array allocations*/ + 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 */ + 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); + +} diff --git a/2.3-1/src/c/matrixOperations/inversion/i8inverma.c b/2.3-1/src/c/matrixOperations/inversion/i8inverma.c new file mode 100644 index 00000000..24fb920c --- /dev/null +++ b/2.3-1/src/c/matrixOperations/inversion/i8inverma.c @@ -0,0 +1,55 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include <stdio.h> +#include <stdlib.h> +#include "matrixInversion.h" +#include "lapack.h" + +void i8inverma ( int8* in, float* out, int leadDimIn ) +{ + + int i = 0 ; + /* 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; + + + + /* Array allocations*/ + 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 */ + 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); + +} diff --git a/2.3-1/src/c/matrixOperations/inversion/u16inverma.c b/2.3-1/src/c/matrixOperations/inversion/u16inverma.c new file mode 100644 index 00000000..a27182d2 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/inversion/u16inverma.c @@ -0,0 +1,55 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include <stdio.h> +#include <stdlib.h> +#include "matrixInversion.h" +#include "lapack.h" + +void u16inverma ( uint16* in, float* out, int leadDimIn ) +{ + + int i = 0 ; + /* 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; + + + + /* Array allocations*/ + 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 */ + 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); + +} diff --git a/2.3-1/src/c/matrixOperations/inversion/u8inverma.c b/2.3-1/src/c/matrixOperations/inversion/u8inverma.c new file mode 100644 index 00000000..4e8a97c0 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/inversion/u8inverma.c @@ -0,0 +1,55 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include <stdio.h> +#include <stdlib.h> +#include "matrixInversion.h" +#include "lapack.h" + +void u8inverma ( uint8* in, float* out, int leadDimIn ) +{ + + int i = 0 ; + /* 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; + + + + /* Array allocations*/ + 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 */ + 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); + +} diff --git a/2.3-1/src/c/matrixOperations/ones/i16onesa.c b/2.3-1/src/c/matrixOperations/ones/i16onesa.c new file mode 100644 index 00000000..b7949de7 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/ones/i16onesa.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "ones.h" + +void i16onesa ( int16* in , int rows , int cols ) +{ + int i = 0 ; + + for ( i = 0 ; i < rows*cols ; i++) + { + in[i] = (int16)1 ; + + } + +} + + + diff --git a/2.3-1/src/c/matrixOperations/ones/i8onesa.c b/2.3-1/src/c/matrixOperations/ones/i8onesa.c new file mode 100644 index 00000000..7c179124 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/ones/i8onesa.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "ones.h" + +void i8onesa ( int8* in , int rows , int cols ) +{ + int i = 0 ; + + for ( i = 0 ; i < rows*cols ; i++) + { + in[i] = (int8)1 ; + + } + +} + + + diff --git a/2.3-1/src/c/matrixOperations/ones/u16onesa.c b/2.3-1/src/c/matrixOperations/ones/u16onesa.c new file mode 100644 index 00000000..852ceef3 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/ones/u16onesa.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "ones.h" + +void u16onesa ( uint16* in , int rows , int cols ) +{ + int i = 0 ; + + for ( i = 0 ; i < rows*cols ; i++) + { + in[i] = (uint16)1 ; + + } + +} + + + diff --git a/2.3-1/src/c/matrixOperations/ones/u8onesa.c b/2.3-1/src/c/matrixOperations/ones/u8onesa.c new file mode 100644 index 00000000..7918a962 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/ones/u8onesa.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "ones.h" + +void u8onesa ( uint8* in , int rows , int cols ) +{ + int i = 0 ; + + for ( i = 0 ; i < rows*cols ; i++) + { + in[i] = (uint8)1 ; + + } + +} + + + diff --git a/2.3-1/src/c/matrixOperations/zeros/i16zerosa.c b/2.3-1/src/c/matrixOperations/zeros/i16zerosa.c new file mode 100644 index 00000000..f1ed904b --- /dev/null +++ b/2.3-1/src/c/matrixOperations/zeros/i16zerosa.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "zeros.h" + +void i16zerosa ( int16* in , int rows , int cols ) +{ + int i = 0 ; + + for ( i = 0 ; i < rows*cols ; i++) + { + in[i] = (int16)0 ; + + } + +} + + + diff --git a/2.3-1/src/c/matrixOperations/zeros/i8zerosa.c b/2.3-1/src/c/matrixOperations/zeros/i8zerosa.c new file mode 100644 index 00000000..e22e06a8 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/zeros/i8zerosa.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "zeros.h" + +void i8zerosa ( int8* in , int rows , int cols ) +{ + int i = 0 ; + + for ( i = 0 ; i < rows*cols ; i++) + { + in[i] = (int8)0 ; + + } + +} + + + diff --git a/2.3-1/src/c/matrixOperations/zeros/u16zerosa.c b/2.3-1/src/c/matrixOperations/zeros/u16zerosa.c new file mode 100644 index 00000000..6c98d2f7 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/zeros/u16zerosa.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "zeros.h" + +void u16zerosa ( uint16* in , int rows , int cols ) +{ + int i = 0 ; + + for ( i = 0 ; i < rows*cols ; i++) + { + in[i] = (uint16)0 ; + + } + +} + + + diff --git a/2.3-1/src/c/matrixOperations/zeros/u8zerosa.c b/2.3-1/src/c/matrixOperations/zeros/u8zerosa.c new file mode 100644 index 00000000..42036148 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/zeros/u8zerosa.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Allan SIMON + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "zeros.h" + +void u8zerosa ( uint8* in , int rows , int cols ) +{ + int i = 0 ; + + for ( i = 0 ; i < rows*cols ; i++) + { + in[i] = (uint8)0 ; + + } + +} + + + |