diff options
author | siddhu8990 | 2015-11-28 02:14:11 +0530 |
---|---|---|
committer | siddhu8990 | 2015-11-28 02:14:11 +0530 |
commit | fd8c4f9bc0763e85c16a59c7639803fd09663281 (patch) | |
tree | c3edb6c759627babbde74657e678c3bd1b96e8ed /2.3-1/src/c | |
parent | 3bcc8ce62560f36eaaab0e064b169b0118f354f3 (diff) | |
parent | fc6021634482f01e2eb7a485717b2bc3cd6355f3 (diff) | |
download | Scilab2C-fd8c4f9bc0763e85c16a59c7639803fd09663281.tar.gz Scilab2C-fd8c4f9bc0763e85c16a59c7639803fd09663281.tar.bz2 Scilab2C-fd8c4f9bc0763e85c16a59c7639803fd09663281.zip |
Merge pull request #1 from Mushirahmed/master
Files updated by Mushir merged with main branch.
Diffstat (limited to '2.3-1/src/c')
177 files changed, 4637 insertions, 47 deletions
diff --git a/2.3-1/src/c/auxiliaryFunctions/find/i16finda.c b/2.3-1/src/c/auxiliaryFunctions/find/i16finda.c new file mode 100644 index 00000000..f7bde00d --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/find/i16finda.c @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "find.h" + +void i16finda(int16* x, int size, int16 *out, int max) +{ + int i = 0; + int j = 0; + + /* if out is empty */ + out[0]=-1; + + + for (i = 0; i < size ; ++i) + { + /*to avoid useless search if we only want to find the max first founded value */ + if (j == max) + { + return ; + } + + if (x[i] != 0) + { + out[j] = (int16)(i+1); + ++j; + } + } +} + diff --git a/2.3-1/src/c/auxiliaryFunctions/find/i16finda.c~ b/2.3-1/src/c/auxiliaryFunctions/find/i16finda.c~ new file mode 100644 index 00000000..f7bde00d --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/find/i16finda.c~ @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "find.h" + +void i16finda(int16* x, int size, int16 *out, int max) +{ + int i = 0; + int j = 0; + + /* if out is empty */ + out[0]=-1; + + + for (i = 0; i < size ; ++i) + { + /*to avoid useless search if we only want to find the max first founded value */ + if (j == max) + { + return ; + } + + if (x[i] != 0) + { + out[j] = (int16)(i+1); + ++j; + } + } +} + diff --git a/2.3-1/src/c/auxiliaryFunctions/find/i8finda.c b/2.3-1/src/c/auxiliaryFunctions/find/i8finda.c new file mode 100644 index 00000000..068c1259 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/find/i8finda.c @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "find.h" + +void i8finda(int8* x, int size, int8 *out, int max) +{ + int i = 0; + int j = 0; + + /* if out is empty */ + out[0]=-1; + + + for (i = 0; i < size ; ++i) + { + /*to avoid useless search if we only want to find the max first founded value */ + if (j == max) + { + return ; + } + + if (x[i] != 0) + { + out[j] = (int8)(i+1); + ++j; + } + } +} + diff --git a/2.3-1/src/c/auxiliaryFunctions/find/i8finda.c~ b/2.3-1/src/c/auxiliaryFunctions/find/i8finda.c~ new file mode 100644 index 00000000..ac223ae2 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/find/i8finda.c~ @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "find.h" + +void dfinda(double* x, int size, double *out, int max) +{ + int i = 0; + int j = 0; + + /* if out is empty */ + out[0]=-1; + + + for (i = 0; i < size ; ++i) + { + /*to avoid useless search if we only want to find the max first founded value */ + if (j == max) + { + return ; + } + + if (x[i] != 0) + { + out[j] = (double)(i+1); + ++j; + } + } +} + diff --git a/2.3-1/src/c/auxiliaryFunctions/find/u16finda.c b/2.3-1/src/c/auxiliaryFunctions/find/u16finda.c new file mode 100644 index 00000000..3096d611 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/find/u16finda.c @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "find.h" + +void u16finda(uint16* x, int size, uint16 *out, int max) +{ + int i = 0; + int j = 0; + + /* if out is empty */ + out[0]=-1; + + + for (i = 0; i < size ; ++i) + { + /*to avoid useless search if we only want to find the max first founded value */ + if (j == max) + { + return ; + } + + if (x[i] != 0) + { + out[j] = (uint16)(i+1); + ++j; + } + } +} + diff --git a/2.3-1/src/c/auxiliaryFunctions/find/u16finda.c~ b/2.3-1/src/c/auxiliaryFunctions/find/u16finda.c~ new file mode 100644 index 00000000..3096d611 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/find/u16finda.c~ @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "find.h" + +void u16finda(uint16* x, int size, uint16 *out, int max) +{ + int i = 0; + int j = 0; + + /* if out is empty */ + out[0]=-1; + + + for (i = 0; i < size ; ++i) + { + /*to avoid useless search if we only want to find the max first founded value */ + if (j == max) + { + return ; + } + + if (x[i] != 0) + { + out[j] = (uint16)(i+1); + ++j; + } + } +} + diff --git a/2.3-1/src/c/auxiliaryFunctions/find/u8finda.c b/2.3-1/src/c/auxiliaryFunctions/find/u8finda.c new file mode 100644 index 00000000..d571c7c3 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/find/u8finda.c @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "find.h" + +void u8finda(uint8* x, int size, uint8 *out, int max) +{ + int i = 0; + int j = 0; + + /* if out is empty */ + out[0]=-1; + + + for (i = 0; i < size ; ++i) + { + /*to avoid useless search if we only want to find the max first founded value */ + if (j == max) + { + return ; + } + + if (x[i] != 0) + { + out[j] = (uint8)(i+1); + ++j; + } + } +} + diff --git a/2.3-1/src/c/auxiliaryFunctions/find/u8finda.c~ b/2.3-1/src/c/auxiliaryFunctions/find/u8finda.c~ new file mode 100644 index 00000000..d571c7c3 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/find/u8finda.c~ @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "find.h" + +void u8finda(uint8* x, int size, uint8 *out, int max) +{ + int i = 0; + int j = 0; + + /* if out is empty */ + out[0]=-1; + + + for (i = 0; i < size ; ++i) + { + /*to avoid useless search if we only want to find the max first founded value */ + if (j == max) + { + return ; + } + + if (x[i] != 0) + { + out[j] = (uint8)(i+1); + ++j; + } + } +} + diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/find.h b/2.3-1/src/c/auxiliaryFunctions/includes/find.h index 3104e957..8072f745 100644 --- a/2.3-1/src/c/auxiliaryFunctions/includes/find.h +++ b/2.3-1/src/c/auxiliaryFunctions/includes/find.h @@ -16,6 +16,7 @@ #include "dynlib_auxiliaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -44,6 +45,32 @@ EXTERN_AUXFUNCT void cfinda(floatComplex* z, int size, float *out, int max); */ EXTERN_AUXFUNCT void zfinda(doubleComplex* z, int size, double *out, int max); +/* +** \brief uint8 Find function +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void u8finda(uint8 *x, int size, uint8 *out, int max); + +/* +** \brief uint16 Find function +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void u16finda(uint16 *x, int size, uint16 *out, int max); + +/* +** \brief int8 Find function +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void i8finda(int8 *x, int size, int8 *out, int max); + +/* +** \brief int16 Find function +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void i16finda(int16 *x, int size, int16 *out, int max); + + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/2.3-1/src/c/auxiliaryFunctions/interfaces/int_find.h b/2.3-1/src/c/auxiliaryFunctions/interfaces/int_find.h index 891aad7e..ec1e1575 100644 --- a/2.3-1/src/c/auxiliaryFunctions/interfaces/int_find.h +++ b/2.3-1/src/c/auxiliaryFunctions/interfaces/int_find.h @@ -25,6 +25,14 @@ #define z0findd0(in) ((zreals(in) == 0) && (zimags(in) == 0)) ? -1 : 1 +#define u80findu80(in) (in == 0) ? -1 : 1 + +#define u160findu160(in) (in == 0) ? -1 : 1 + +#define i80findi80(in) (in == 0) ? -1 : 1 + +#define i160findi160(in) (in == 0) ? -1 : 1 + #define s2finds2(in,size,out) sfinda(in, size[0]*size[1], out, -1) #define d2findd2(in,size,out) dfinda(in, size[0]*size[1], out, -1) @@ -33,6 +41,14 @@ #define z2findd2(in,size,out) zfinda(in, size[0]*size[1], out, -1) +#define u82findu82(in,size,out) u8finda(in,size[0]*size[1],out, -1) + +#define u162findu162(in,size,out) u16finda(in,size[0]*size[1],out, -1) + +#define i82findi82(in,size,out) i8finda(in,size[0]*size[1],out, -1) + +#define i162findi162(in,size,out) i16finda(in,size[0]*size[1],out, -1) + /* 1 input, 2 outputs */ #define s0finds0s0(in,out2) *out2 = s0finds0(in);s0finds0(in) @@ -43,10 +59,18 @@ #define z0findd0d0(in,out2) if ((zreals(in)==0) && (zimags(in)==0)) {out2=0;} else {out2=1;} +#define u80findu80u80(in,out2) *out2 = u80findu80(in);u80findu80(in) + +#define u160findu160u160(in,out2) *out2 = u160findu160(in);u160findu160(in) + +#define i80findi80i80(in,out2) *out2 = i80findi80(in);i80findi80(in) + +#define i160findi160i160(in,out2) *out2 = i160findi160(in);i160findi160(in) + #define s2finds2s2(in,size,out1,sizeOut1,out2,sizeOut2) sfind2da(in,size[0],size[1],out1,sizeOut1,out2,sizeOut2,-1) -#define d2findd2d2(in,size,out1,out2) dfind2da(in,size[0],size[1],out1,out2,-1) +#define d2findd2d2(in,size,out1,out2) dfind2da(in,size[0],size[1],out1,out2,-1) #define c2finds2s2(in,size,out1,sizeOut1,out2,sizeOut2) cfind2da(in,size[0],size[1],out1,sizeOut1,out2,sizeOut2,-1) @@ -62,6 +86,14 @@ #define z0d0findd0(in1,in2) z0findd0(in1) +#define u80u80findu80(in1,in2) u80findu80(in1) + +#define u160u160findu160(in1,in2) u160findu160(in1) + +#define i80i80findi80(in1,in2) i80findi80(in1) + +#define i160i160findi160(in1,in2) i160findi160(in1) + #define s2s0finds2(in1,size,in2,out) {\ int temp_out_indice[2] = {0} ;\ sfinda(in1,size[0]*size[1],out,in2);\ @@ -82,6 +114,25 @@ zfinda(in1,size[0]*size[1],out,in2);\ } +#define u82u80findu82(in1,size,in2,out) {\ + int temp_out_indice[2] = {0};\ + u8finda(in1,size[0]*size[1],out,in2);\ +} + +#define u162u160findu162(in1,size,in2,out) {\ + int temp_out_indice[2] = {0};\ + u16finda(in1,size[0]*size[1],out,in2);\ +} + +#define i82i80findi82(in1,size,in2,out) {\ + int temp_out_indice[2] = {0};\ + i8finda(in1,size[0]*size[1],out,in2);\ +} + +#define i162i160findi162(in1,size,in2,out) {\ + int temp_out_indice[2] = {0};\ + i16finda(in1,size[0]*size[1],out,in2);\ +} /* 2 inputs, 2 outputs */ #define s0s0finds0s0(in1,in2,out1,out2) s0finds0s0(in1,out1,out2) @@ -92,6 +143,14 @@ #define z0d0findd0d0(in1,in2,out1,out2) z0findd0d0(in1,out1,out2) +#define u80u80findu80u80(in1,in2,out1,out2) u80findu80u80(in1,out1,out2) + +#define u160u160findu160u160(in1,in2,out1,out2) u160findu160u160(in1,out1,out2) + +#define i80i80findi80i80(in1,in2,out1,out2) i80findi80i80(in1,out1,out2) + +#define i160i60findi60i60(in1,in2,out1,out2) i60findi60i60(in1,out1,out2) + /*FIXME : prototypes are wrong*/ #define s2s0finds2s2(in1,size,in2,out1,out2) {\ diff --git a/2.3-1/src/c/elementaryFunctions/includes/pow.h b/2.3-1/src/c/elementaryFunctions/includes/pow.h index ec8216d8..de1eb409 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/pow.h +++ b/2.3-1/src/c/elementaryFunctions/includes/pow.h @@ -27,6 +27,14 @@ EXTERN_ELEMFUNCT floatComplex cpows(floatComplex value, floatComplex expand); EXTERN_ELEMFUNCT doubleComplex zpows(doubleComplex value, doubleComplex expand); +EXTERN_ELEMFUNCT uint8 u8pows(uint8 value, uint8 expand); + +EXTERN_ELEMFUNCT uint16 u16pows(uint16 value, uint16 expand); + +EXTERN_ELEMFUNCT int8 i8pows(int8 value, int8 expand); + +EXTERN_ELEMFUNCT int16 i16pows(int16 value, int16 expand); + EXTERN_ELEMFUNCT void spowa(float *value, int size, float* expand, float *out); EXTERN_ELEMFUNCT void dpowa(double *value, int size, double* expand, double *out); @@ -35,6 +43,14 @@ EXTERN_ELEMFUNCT void cpowa(floatComplex *value, int size, floatComplex* expand EXTERN_ELEMFUNCT void zpowa(doubleComplex *value, int size, doubleComplex* expand, doubleComplex *out); +EXTERN_ELEMFUNCT void u8powa(uint8 *value, int size, uint8* expand, uint8 *out); + +EXTERN_ELEMFUNCT void u16powa(uint16 *value, int size, uint16* expand, uint16 *out); + +EXTERN_ELEMFUNCT void i8powa(int8 *value, int size, int8* expand, int8 *out); + +EXTERN_ELEMFUNCT void i16powa(int16 *value, int size, int16* expand, int16 *out); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/2.3-1/src/c/elementaryFunctions/includes/sqrt.h b/2.3-1/src/c/elementaryFunctions/includes/sqrt.h index 7885c9c2..df11b20e 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/sqrt.h +++ b/2.3-1/src/c/elementaryFunctions/includes/sqrt.h @@ -16,6 +16,7 @@ #include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -48,13 +49,14 @@ EXTERN_ELEMFUNCT floatComplex csqrts(floatComplex in); */ EXTERN_ELEMFUNCT doubleComplex zsqrts(doubleComplex in); + /* ** \brief Float Matrix Square Root function ** \param in : input array value. ** \param out : output array value. ** \param size : the size of in and out arrays. */ -EXTERN_ELEMFUNCT void ssqrta(float* in, int size, float* out); +EXTERN_ELEMFUNCT void ssqrta(float* in, int size, float* out); /* ** \brief Double Matrix Square Root function @@ -80,6 +82,10 @@ EXTERN_ELEMFUNCT void csqrta(floatComplex* in, int size, floatComplex* out); */ EXTERN_ELEMFUNCT void zsqrta(doubleComplex* in, int size, doubleComplex* out); + + + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_OpDotHat.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_OpDotHat.h index 8e5c7042..2444f100 100644 --- a/2.3-1/src/c/elementaryFunctions/interfaces/int_OpDotHat.h +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_OpDotHat.h @@ -25,6 +25,14 @@ #define z0z0OpDotHatz0(in1, in2) zpows(in1, in2) +#define u80u80OpDotHatu80(in1, in2) u8pows(in1, in2) + +#define u160u160OpDotHatu160(in1, in2) u16pows(in1, in2) + +#define i80i80OpDotHati80(in1, in2) i8pows(in1, in2) + +#define i160i160OpDotHati60(in1, in2) i16pows(in1, in2) + #define s0c0OpDotHatc0(in1, in2) cpows(FloatComplex(in1,0), in2) #define c0s0OpDotHatc0(in1, in2) cpows(in1, FloatComplex(in2,0)) @@ -53,6 +61,20 @@ for (i=0;i<size[0]*size[1];i++) out[i]=zpows(in1,in2[i]);\ } +#define u80u82OpDotHatu82(in1, in2, size, out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=u8pows(in1,in2[i]);\ + } + +#define u160u162OpDotHatu162(in1, in2, size, out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=u16pows(in1,in2[i]);\ + } +#define i80i82OpDotHati82(in1, in2, size, out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=i8pows(in1,in2[i]);\ + } + +#define i160i162OpDotHati162(in1, in2, size, out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=i16pows(in1,in2[i]);\ + } #define s0c2OpDotHatc2(in1, in2, size, out) {int i=0;\ @@ -90,6 +112,23 @@ for (i=0;i<size[0]*size[1];i++) out[i]=zpows(in1[i],in2);\ } +#define u82u80OpDotHatu82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=u8pows(in1[i],in2);\ + } + +#define u162u160OpDotHatu162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=u16pows(in1[i],in2);\ + } + +#define i82i80OpDotHati82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=i8pows(in1[i],in2);\ + } + +#define i162i160OpDotHati162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=i16pows(in1[i],in2);\ + } + + #define s2c0OpDotHatc2(in1,size,in2,out) {int i=0;\ for (i=0;i<size[0]*size[1];i++) out[i]=cpows(FloatComplex(in1[i],0),in2);\ } @@ -106,6 +145,24 @@ for (i=0;i<size[0]*size[1];i++) out[i]=zpows(in1[i],DoubleComplex(in2,0));\ } +#define u82d0OpDotHatu82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=u8pows(in1[i],in2);\ + } + +#define u162d0OpDotHatu162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=u16pows(in1[i],in2);\ + } + + +#define i82d0OpDotHati82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=i8pows(in1[i],in2);\ + } + +#define i162d0OpDotHatui62(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=i16pows(in1[i],in2);\ + } + + /* Matrix - Matrix */ @@ -117,6 +174,14 @@ #define z2z2OpDotHatz2(in1, size1, in2, size2, out) zpowa(in1, size1[0]*size2[1], in2, out) +#define u82u82OpDotHatu82(in1, size1, in2, size2, out) u8powa(in1, size1[0]*size2[1], in2, out) + +#define u162u162OpDotHatu162(in1, size1, in2, size2, out) u16powa(in1, size1[0]*size2[1], in2, out) + +#define i82i82OpDotHati82(in1, size1, in2, size2, out) i8powa(in1, size1[0]*size2[1], in2, out) + +#define i162i162OpDotHati162(in1, size1, in2, size2, out) i16powa(in1, size1[0]*size2[1], in2, out) + #define s2c2OpDotHatc2(in1, size1, in2, size2, out) {int i=0;\ for (i=0;i<size1[0]*size2[1];i++) out[i]=cpows(FloatComplex(in1[i],0),in2[i]);\ } diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_OpHat.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_OpHat.h index 8cc8849c..f1bb8d51 100644 --- a/2.3-1/src/c/elementaryFunctions/interfaces/int_OpHat.h +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_OpHat.h @@ -23,6 +23,14 @@ #define c0c0OpHatc0(in1, in2) cpows(in1, in2) +#define u80u80OpHatu80(in1,in2) u8pows(in1, in2) + +#define u160u160OpHatu160(in1,in2) u16pows(in1, in2) + +#define i80i80OpHati80(in1,in2) i8pows(in1, in2) + +#define i160i60OpHati60(in1,in2) i6pows(in1, in2) + #define s0c0OpHatc0(in1, in2) cpows(FloatComplex(in1,0), in2) #define c0s0OpHatc0(in1, in2) cpows(in1, FloatComplex(in2,0)) @@ -54,6 +62,25 @@ for (i=0;i<size[0]*size[1];i++) out[i]=zpows(in1,in2[i]);\ } +#define u80u82OpHatu82(in1, in2, size, out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=u8pows(in1,in2[i]);\ + } + + +#define u160u162OpHatu162(in1, in2, size, out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=u16pows(in1,in2[i]);\ + } + +#define i80i82OpHati82(in1, in2, size, out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=i8pows(in1,in2[i]);\ + } + + +#define i160i162OpHati162(in1, in2, size, out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=i16pows(in1,in2[i]);\ + } + + #define s0c2OpHatc2(in1, in2, size, out) {int i=0;\ @@ -84,6 +111,22 @@ #define z2z0OpHatz2(in1,size,in2,out) zpowma(in1,size[0],in2,out); +#define u82u80OpHatu82(in1,size,in2,out) u8powa(in1,size[0],in2,out) + +#define u162u162OpHatu162(in1,size,in2,out) u16powa(in1,size[0],in2,out) + +#define i82i80OpHati82(in1,size,in2,out) i8powa(in1,size[0],in2,out) + +#define i162i160OpHati82(in1,size,in2,out) i16powa(in1,size[0],in2,out) + +#define u82d0OpHatu82(in1,size,in2,out) u8powa(in1,size[0],in2,out) + +#define u162d0OpHatu162(in1,size,in2,out) u16powa(in1,size[0],in2,out) + +#define i82d0OpHati82(in1,size,in2,out) i8powa(in1,size[0],in2,out) + +#define i162d0OpHati162(in1,sine,in2,out) i16powa(in1,size[0],in2,out) + /* FIXME : malloc here */ #define s2c0OpHatc2(in1,size,in2,out) {float* tmp;\ tmp = malloc((uint)(size[0]*size[1])*sizeof(float));\ diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_sqrt.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_sqrt.h index 0efbca96..090d9825 100644 --- a/2.3-1/src/c/elementaryFunctions/interfaces/int_sqrt.h +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_sqrt.h @@ -33,27 +33,32 @@ #define __INT_SQRT_H__ #define s0sqrts0(in) ssqrts(in) -
+ #define s0sqrtc0(in) csqrts(FloatComplex(in,0)) #define d0sqrtd0(in) dsqrts(in) -
+ #define d0sqrtz0(in) zsqrts(DoubleComplex(in,0)) #define c0sqrtc0(in) csqrts(in) -
+ #define z0sqrtz0(in) zsqrts(in) -
+ + + #define s2sqrts2(in,size,out) ssqrta(in, size[0]*size[1], out) #define s2sqrtc2(in,size,out) csqrta(FloatComplexMatrix(in,0), size[0]*size[1], out) #define d2sqrtd2(in,size,out) dsqrta(in, size[0]*size[1], out) -
+ #define d2sqrtz2(in,size,out) zsqrta(DoubleComplexMatrix(in,0), size[0]*size[1], out) #define c2sqrtc2(in,size,out) csqrta(in, size[0]*size[1], out) -
-#define z2sqrtz2(in,size,out) zsqrta(in, size[0]*size[1], out)
+ +#define z2sqrtz2(in,size,out) zsqrta(in, size[0]*size[1], out) + + + #endif /* !__INT_SQRT_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/pow/dpows.c b/2.3-1/src/c/elementaryFunctions/pow/dpows.c index c291bf71..cce89196 100644 --- a/2.3-1/src/c/elementaryFunctions/pow/dpows.c +++ b/2.3-1/src/c/elementaryFunctions/pow/dpows.c @@ -13,6 +13,7 @@ #include <math.h> #include "pow.h" -double dpows(double x, double p) { +double dpows(double x, double p) +{ return pow(x, p); } diff --git a/2.3-1/src/c/elementaryFunctions/pow/dpows.c~ b/2.3-1/src/c/elementaryFunctions/pow/dpows.c~ new file mode 100644 index 00000000..cce89196 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/dpows.c~ @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "pow.h" + +double dpows(double x, double p) +{ + return pow(x, p); +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/i16powa.c b/2.3-1/src/c/elementaryFunctions/pow/i16powa.c new file mode 100644 index 00000000..e8e87fd3 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/i16powa.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 "pow.h" + +void i16powa(int16* x, int size, int16* power, int16 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = i16pows(x[i], power[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/i16powa.c~ b/2.3-1/src/c/elementaryFunctions/pow/i16powa.c~ new file mode 100644 index 00000000..e8e87fd3 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/i16powa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 "pow.h" + +void i16powa(int16* x, int size, int16* power, int16 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = i16pows(x[i], power[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/i16pows.c b/2.3-1/src/c/elementaryFunctions/pow/i16pows.c new file mode 100644 index 00000000..c8068c75 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/i16pows.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "pow.h" + +int16 i16pows(int16 x, int16 p) { + return pow(x, p); +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/i16pows.c~ b/2.3-1/src/c/elementaryFunctions/pow/i16pows.c~ new file mode 100644 index 00000000..c8068c75 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/i16pows.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "pow.h" + +int16 i16pows(int16 x, int16 p) { + return pow(x, p); +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/i8powa.c b/2.3-1/src/c/elementaryFunctions/pow/i8powa.c new file mode 100644 index 00000000..e17b666d --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/i8powa.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 "pow.h" + +void i8powa(int8* x, int size, int8* power, int8 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = i8pows(x[i], power[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/i8powa.c~ b/2.3-1/src/c/elementaryFunctions/pow/i8powa.c~ new file mode 100644 index 00000000..e17b666d --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/i8powa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 "pow.h" + +void i8powa(int8* x, int size, int8* power, int8 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = i8pows(x[i], power[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/i8pows.c b/2.3-1/src/c/elementaryFunctions/pow/i8pows.c new file mode 100644 index 00000000..3566c417 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/i8pows.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "pow.h" + +int8 i8pows(int8 x, int8 p) { + return pow(x, p); +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/i8pows.c~ b/2.3-1/src/c/elementaryFunctions/pow/i8pows.c~ new file mode 100644 index 00000000..3566c417 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/i8pows.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "pow.h" + +int8 i8pows(int8 x, int8 p) { + return pow(x, p); +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/u16powa.c b/2.3-1/src/c/elementaryFunctions/pow/u16powa.c new file mode 100644 index 00000000..65ba77e7 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/u16powa.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 "pow.h" + +void u16powa(uint16* x, int size, uint16* power, uint16 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = u16pows(x[i], power[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/u16powa.c~ b/2.3-1/src/c/elementaryFunctions/pow/u16powa.c~ new file mode 100644 index 00000000..65ba77e7 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/u16powa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 "pow.h" + +void u16powa(uint16* x, int size, uint16* power, uint16 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = u16pows(x[i], power[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/u16pows.c b/2.3-1/src/c/elementaryFunctions/pow/u16pows.c new file mode 100644 index 00000000..34672b0f --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/u16pows.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "pow.h" + +uint16 u16pows(uint16 x, uint16 p) { + return pow(x, p); +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/u16pows.c~ b/2.3-1/src/c/elementaryFunctions/pow/u16pows.c~ new file mode 100644 index 00000000..34672b0f --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/u16pows.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "pow.h" + +uint16 u16pows(uint16 x, uint16 p) { + return pow(x, p); +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/u8powa.c b/2.3-1/src/c/elementaryFunctions/pow/u8powa.c new file mode 100644 index 00000000..b69431c7 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/u8powa.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 "pow.h" + +void u8powa(uint8* x, int size, uint8* power, uint8 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = u8pows(x[i], power[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/u8powa.c~ b/2.3-1/src/c/elementaryFunctions/pow/u8powa.c~ new file mode 100644 index 00000000..b69431c7 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/u8powa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 "pow.h" + +void u8powa(uint8* x, int size, uint8* power, uint8 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = u8pows(x[i], power[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/u8pows.c b/2.3-1/src/c/elementaryFunctions/pow/u8pows.c new file mode 100644 index 00000000..786b9194 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/u8pows.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "pow.h" + +uint8 u8pows(uint8 x, uint8 p) +{ + return pow(x, p); +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/u8pows.c~ b/2.3-1/src/c/elementaryFunctions/pow/u8pows.c~ new file mode 100644 index 00000000..4b5042ff --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/u8pows.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "pow.h" + +uint8 u8pows(uint8 x, uint8 p) { + return pow(x, p); +} diff --git a/2.3-1/src/c/elementaryFunctions/pow/zpows.c b/2.3-1/src/c/elementaryFunctions/pow/zpows.c index 1a7059b2..4fe771ab 100644 --- a/2.3-1/src/c/elementaryFunctions/pow/zpows.c +++ b/2.3-1/src/c/elementaryFunctions/pow/zpows.c @@ -14,7 +14,7 @@ #include "log.h" #include "exp.h" -doubleComplex zpows(doubleComplex z, doubleComplex power) { +doubleComplex zpows(doubleComplex z, doubleComplex power) { /*Cas z=0 */ if ( (zreals(z)==0) && (zimags(z)==0) ){ /* Cas 0^0 */ diff --git a/2.3-1/src/c/elementaryFunctions/pow/zpows.c~ b/2.3-1/src/c/elementaryFunctions/pow/zpows.c~ new file mode 100644 index 00000000..1a7059b2 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pow/zpows.c~ @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "pow.h" +#include "log.h" +#include "exp.h" + +doubleComplex zpows(doubleComplex z, doubleComplex power) { + /*Cas z=0 */ + if ( (zreals(z)==0) && (zimags(z)==0) ){ + /* Cas 0^0 */ + if ( (zreals(power)==0) && (zimags(power)==0) ) return DoubleComplex(1,0); + /* Cas 0^x, x!=0 */ + return DoubleComplex(0,0); + } + + /* Cas z!=0 */ + return zexps(zmuls(zlogs(z), power)); +} diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/dsqrta.c b/2.3-1/src/c/elementaryFunctions/sqrt/dsqrta.c index a948f35b..b87800f4 100644 --- a/2.3-1/src/c/elementaryFunctions/sqrt/dsqrta.c +++ b/2.3-1/src/c/elementaryFunctions/sqrt/dsqrta.c @@ -12,7 +12,7 @@ #include "sqrt.h" -void dsqrta(double* in, int size, double* out) { +void dsqrta(double* in, int size, double* out) { int i = 0; for (i = 0 ; i < size ; ++i) { out[i] = dsqrts(in[i]); diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/dsqrta.c~ b/2.3-1/src/c/elementaryFunctions/sqrt/dsqrta.c~ new file mode 100644 index 00000000..a948f35b --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sqrt/dsqrta.c~ @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "sqrt.h" + +void dsqrta(double* in, int size, double* out) { + int i = 0; + for (i = 0 ; i < size ; ++i) { + out[i] = dsqrts(in[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/dsqrts.c b/2.3-1/src/c/elementaryFunctions/sqrt/dsqrts.c index 350cbbd0..8e664495 100644 --- a/2.3-1/src/c/elementaryFunctions/sqrt/dsqrts.c +++ b/2.3-1/src/c/elementaryFunctions/sqrt/dsqrts.c @@ -13,6 +13,6 @@ #include <math.h> #include "sqrt.h" -double dsqrts(double in){ +double dsqrts(double in){ return sqrt(in); } diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/dsqrts.c~ b/2.3-1/src/c/elementaryFunctions/sqrt/dsqrts.c~ new file mode 100644 index 00000000..350cbbd0 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sqrt/dsqrts.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "sqrt.h" + +double dsqrts(double in){ + return sqrt(in); +} diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/i16sqrta.c~ b/2.3-1/src/c/elementaryFunctions/sqrt/i16sqrta.c~ new file mode 100644 index 00000000..95a67982 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sqrt/i16sqrta.c~ @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "sqrt.h" + +void i16sqrta(int16* in, int size, int16* out) { + int i = 0; + for (i = 0 ; i < size ; ++i) { + out[i] = i16sqrts(in[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/i16sqrts.c~ b/2.3-1/src/c/elementaryFunctions/sqrt/i16sqrts.c~ new file mode 100644 index 00000000..2f286214 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sqrt/i16sqrts.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "sqrt.h" + +int16 i16sqrts(int16 in){ + return sqrt(in); +} diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/i8sqrta.c~ b/2.3-1/src/c/elementaryFunctions/sqrt/i8sqrta.c~ new file mode 100644 index 00000000..b4b40c48 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sqrt/i8sqrta.c~ @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "sqrt.h" + +void i8sqrta(int8* in, int size, int8* out) { + int i = 0; + for (i = 0 ; i < size ; ++i) { + out[i] = i8sqrts(in[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/i8sqrts.c~ b/2.3-1/src/c/elementaryFunctions/sqrt/i8sqrts.c~ new file mode 100644 index 00000000..bbd6997e --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sqrt/i8sqrts.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "sqrt.h" + +int8 i8sqrts(int8 in){ + return sqrt(in); +} diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/u16sqrta.c~ b/2.3-1/src/c/elementaryFunctions/sqrt/u16sqrta.c~ new file mode 100644 index 00000000..2589a67d --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sqrt/u16sqrta.c~ @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "sqrt.h" + +void u16sqrta(uint16* in, int size, float* out) { + int i = 0; + for (i = 0 ; i < size ; ++i) { + out[i] = u16sqrts(in[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/u16sqrts.c~ b/2.3-1/src/c/elementaryFunctions/sqrt/u16sqrts.c~ new file mode 100644 index 00000000..1226025e --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sqrt/u16sqrts.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "sqrt.h" + +float u16sqrts(uint16 in){ + return sqrt(in); +} diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/u8sqrta.c~ b/2.3-1/src/c/elementaryFunctions/sqrt/u8sqrta.c~ new file mode 100644 index 00000000..03424b99 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sqrt/u8sqrta.c~ @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 "sqrt.h" + +void u8sqrta(uint8* in, int size, float* out) { + int i = 0; + for (i = 0 ; i < size ; ++i) { + out[i] = u8sqrts(in[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/sqrt/u8sqrts.c~ b/2.3-1/src/c/elementaryFunctions/sqrt/u8sqrts.c~ new file mode 100644 index 00000000..29ecc40c --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sqrt/u8sqrts.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 <math.h> +#include "sqrt.h" + +float u8sqrts(uint8 in){ + return sqrt(in); +} diff --git a/2.3-1/src/c/matrixOperations/includes/matrixTrace.h b/2.3-1/src/c/matrixOperations/includes/matrixTrace.h index 76b77454..80f895df 100644 --- a/2.3-1/src/c/matrixOperations/includes/matrixTrace.h +++ b/2.3-1/src/c/matrixOperations/includes/matrixTrace.h @@ -16,6 +16,7 @@ #include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -63,6 +64,44 @@ EXTERN_MATOPS floatComplex ctracea ( floatComplex* in ,int lines ) ; */ EXTERN_MATOPS doubleComplex ztracea ( doubleComplex* in ,int lines ) ; + +/* +** \brief Compute the trace of a uint8 matrix. +** \param in : input array. +** \param lines : number of lines +** \param out : uint8 containing the trace. +*/ +EXTERN_MATOPS uint8 u8tracea ( uint8* in ,int lines ) ; + + +/* +** \brief Compute the trace of a uint16 matrix. +** \param in : input array. +** \param lines : number of lines +** \param out : uint16 containing the trace. +*/ +EXTERN_MATOPS uint16 u16tracea ( uint16* in ,int lines ) ; + + +/* +** \brief Compute the trace of a int8 matrix. +** \param in : input array. +** \param lines : number of lines +** \param out : int8 containing the trace. +*/ +EXTERN_MATOPS int8 i8tracea ( int8* in ,int lines ) ; + + +/* +** \brief Compute the trace of a int16 matrix. +** \param in : input array. +** \param lines : number of lines +** \param out : int16 containing the trace. +*/ +EXTERN_MATOPS int16 i16tracea ( int16* in ,int lines ) ; + + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/2.3-1/src/c/matrixOperations/includes/matrixTranspose.h b/2.3-1/src/c/matrixOperations/includes/matrixTranspose.h index 122b618d..7e2acbf1 100644 --- a/2.3-1/src/c/matrixOperations/includes/matrixTranspose.h +++ b/2.3-1/src/c/matrixOperations/includes/matrixTranspose.h @@ -16,6 +16,7 @@ #include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #include <math.h> #ifdef __cplusplus @@ -54,6 +55,45 @@ EXTERN_MATOPS void ctransposea ( floatComplex* in , int lines1 , int column1, fl */ EXTERN_MATOPS void ztransposea ( doubleComplex* in , int lines1 , int column1, doubleComplex* out ); + +/* +** \brief Compute the transpose of a uint8 matrix. +** \param in : input matrix. +** \param lines1 : number of lines +** \param column1 : number of column1 +** \param out : the transposed uint8 matrix. +*/ +EXTERN_MATOPS void u8transposea ( uint8* in , int lines1 , int column1, uint8* out ); + +/* +** \brief Compute the transpose of a uint16 matrix. +** \param in : input matrix. +** \param lines1 : number of lines +** \param column1 : number of column1 +** \param out : the transposed uint16 matrix. +*/ +EXTERN_MATOPS void u16transposea ( uint16* in , int lines1 , int column1, uint16* out ); + +/* +** \brief Compute the transpose of a int8 matrix. +** \param in : input matrix. +** \param lines1 : number of lines +** \param column1 : number of column1 +** \param out : the transposed int8 matrix. +*/ +EXTERN_MATOPS void i8transposea ( int8* in , int lines1 , int column1, int8* out ); + +/* +** \brief Compute the transpose of a int16 matrix. +** \param in : input matrix. +** \param lines1 : number of lines +** \param column1 : number of column1 +** \param out : the transposed int16 matrix. +*/ +EXTERN_MATOPS void i16transposea ( int16* in , int lines1 , int column1, int16* out ); + + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_trace.h b/2.3-1/src/c/matrixOperations/interfaces/int_trace.h index 8bfea860..58c42991 100644 --- a/2.3-1/src/c/matrixOperations/interfaces/int_trace.h +++ b/2.3-1/src/c/matrixOperations/interfaces/int_trace.h @@ -21,7 +21,13 @@ #define c0tracec0(in) in -#define z0tracez0(in) in +#define u80traceu80(in) (uint8)in + +#define u160traceu160(in) (uint16)in + +#define i80tracei80(in) (int8)in + +#define i160tracei160(in) (int16)in #define s2traces0(in,size) stracea(in, size[0]) @@ -31,4 +37,12 @@ #define z2tracez0(in,size) ztracea(in, size[0]) +#define u82traceu80(in,size) u8tracea(in, size[0]) + +#define u162traceu160(in,size) u16tracea(in, size[0]) + +#define i82tracei80(in,size) i8tracea(in, size[0]) + +#define i162tracei160(in,size) i16trace(in,size[0]) + #endif /* !__INT_TRACE_H__ */ diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_transpose.h b/2.3-1/src/c/matrixOperations/interfaces/int_transpose.h index 250d565f..3fd328f6 100644 --- a/2.3-1/src/c/matrixOperations/interfaces/int_transpose.h +++ b/2.3-1/src/c/matrixOperations/interfaces/int_transpose.h @@ -23,6 +23,14 @@ #define z0transposez0(in) in +#define u80transposeu80(in) (uint8)in + +#define u160transposeu160(in) (uint16)in + +#define i80transposei80(in) (int8)in + +#define i160transposei160(in) (int16)in + #define s2transposes2(in,size,out) stransposea(in, size[0], size[1], out) #define d2transposed2(in,size,out) dtransposea(in, size[0], size[1], out) @@ -31,4 +39,13 @@ #define z2transposez2(in,size,out) ztransposea(in, size[0], size[1], out) + +#define u82transposeu82(in,size,out) u8transposea(in, size[0], size[1], out) + +#define u162transposeu162(in,size,out) u16transposea(in, size[0], size[1], out) + +#define i82transposei82(in,size,out) i8transposea(in, size[0], size[1], out) + +#define i162transposei162(in,size,out) i16transposea(in, size[0], size[1], out) + #endif /* !__INT_TRANSPOSE_H__ */ diff --git a/2.3-1/src/c/matrixOperations/trace/i16tracea.c b/2.3-1/src/c/matrixOperations/trace/i16tracea.c new file mode 100644 index 00000000..6a3d6a8b --- /dev/null +++ b/2.3-1/src/c/matrixOperations/trace/i16tracea.c @@ -0,0 +1,28 @@ +/* + * 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 "matrixTrace.h" + +int16 i16tracea ( int16* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + int16 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (int16)in[i*lines + i] ; + + return out; +} + + diff --git a/2.3-1/src/c/matrixOperations/trace/i16tracea.c~ b/2.3-1/src/c/matrixOperations/trace/i16tracea.c~ new file mode 100644 index 00000000..6a3d6a8b --- /dev/null +++ b/2.3-1/src/c/matrixOperations/trace/i16tracea.c~ @@ -0,0 +1,28 @@ +/* + * 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 "matrixTrace.h" + +int16 i16tracea ( int16* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + int16 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (int16)in[i*lines + i] ; + + return out; +} + + diff --git a/2.3-1/src/c/matrixOperations/trace/i8tracea.c b/2.3-1/src/c/matrixOperations/trace/i8tracea.c new file mode 100644 index 00000000..88a1c46e --- /dev/null +++ b/2.3-1/src/c/matrixOperations/trace/i8tracea.c @@ -0,0 +1,28 @@ +/* + * 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 "matrixTrace.h" + +int8 i8tracea ( int8* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + int8 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (int8)in[i*lines + i] ; + + return out; +} + + diff --git a/2.3-1/src/c/matrixOperations/trace/i8tracea.c~ b/2.3-1/src/c/matrixOperations/trace/i8tracea.c~ new file mode 100644 index 00000000..88a1c46e --- /dev/null +++ b/2.3-1/src/c/matrixOperations/trace/i8tracea.c~ @@ -0,0 +1,28 @@ +/* + * 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 "matrixTrace.h" + +int8 i8tracea ( int8* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + int8 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (int8)in[i*lines + i] ; + + return out; +} + + diff --git a/2.3-1/src/c/matrixOperations/trace/u16tracea.c b/2.3-1/src/c/matrixOperations/trace/u16tracea.c new file mode 100644 index 00000000..3cf9943c --- /dev/null +++ b/2.3-1/src/c/matrixOperations/trace/u16tracea.c @@ -0,0 +1,28 @@ +/* + * 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 "matrixTrace.h" + +uint16 u16tracea ( uint16* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + uint16 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (uint16)in[i*lines + i] ; + + return out; +} + + diff --git a/2.3-1/src/c/matrixOperations/trace/u16tracea.c~ b/2.3-1/src/c/matrixOperations/trace/u16tracea.c~ new file mode 100644 index 00000000..3cf9943c --- /dev/null +++ b/2.3-1/src/c/matrixOperations/trace/u16tracea.c~ @@ -0,0 +1,28 @@ +/* + * 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 "matrixTrace.h" + +uint16 u16tracea ( uint16* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + uint16 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (uint16)in[i*lines + i] ; + + return out; +} + + diff --git a/2.3-1/src/c/matrixOperations/trace/u8tracea.c b/2.3-1/src/c/matrixOperations/trace/u8tracea.c new file mode 100644 index 00000000..97e73e21 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/trace/u8tracea.c @@ -0,0 +1,28 @@ +/* + * 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 "matrixTrace.h" + +uint8 u8tracea ( uint8* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + uint8 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (uint8)in[i*lines + i] ; + + return out; +} + + diff --git a/2.3-1/src/c/matrixOperations/trace/u8tracea.c~ b/2.3-1/src/c/matrixOperations/trace/u8tracea.c~ new file mode 100644 index 00000000..97e73e21 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/trace/u8tracea.c~ @@ -0,0 +1,28 @@ +/* + * 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 "matrixTrace.h" + +uint8 u8tracea ( uint8* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + uint8 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (uint8)in[i*lines + i] ; + + return out; +} + + diff --git a/2.3-1/src/c/matrixOperations/transpose/i16transposea.c b/2.3-1/src/c/matrixOperations/transpose/i16transposea.c new file mode 100644 index 00000000..366de067 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/transpose/i16transposea.c @@ -0,0 +1,27 @@ +/* + * 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 "matrixTranspose.h" + +void i16transposea ( int16* in , int lines , int columns, int16* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (int16)in[i+j*lines]; + } + +} diff --git a/2.3-1/src/c/matrixOperations/transpose/i16transposea.c~ b/2.3-1/src/c/matrixOperations/transpose/i16transposea.c~ new file mode 100644 index 00000000..366de067 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/transpose/i16transposea.c~ @@ -0,0 +1,27 @@ +/* + * 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 "matrixTranspose.h" + +void i16transposea ( int16* in , int lines , int columns, int16* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (int16)in[i+j*lines]; + } + +} diff --git a/2.3-1/src/c/matrixOperations/transpose/i8transposea.c b/2.3-1/src/c/matrixOperations/transpose/i8transposea.c new file mode 100644 index 00000000..20d451a0 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/transpose/i8transposea.c @@ -0,0 +1,27 @@ +/* + * 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 "matrixTranspose.h" + +void i8transposea ( int8* in , int lines , int columns, int8* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (int8)in[i+j*lines]; + } + +} diff --git a/2.3-1/src/c/matrixOperations/transpose/i8transposea.c~ b/2.3-1/src/c/matrixOperations/transpose/i8transposea.c~ new file mode 100644 index 00000000..20d451a0 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/transpose/i8transposea.c~ @@ -0,0 +1,27 @@ +/* + * 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 "matrixTranspose.h" + +void i8transposea ( int8* in , int lines , int columns, int8* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (int8)in[i+j*lines]; + } + +} diff --git a/2.3-1/src/c/matrixOperations/transpose/u16transposea.c b/2.3-1/src/c/matrixOperations/transpose/u16transposea.c new file mode 100644 index 00000000..33b35ecb --- /dev/null +++ b/2.3-1/src/c/matrixOperations/transpose/u16transposea.c @@ -0,0 +1,27 @@ +/* + * 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 "matrixTranspose.h" + +void u16transposea ( uint16* in , int lines , int columns, uint16* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (uint16)in[i+j*lines]; + } + +} diff --git a/2.3-1/src/c/matrixOperations/transpose/u16transposea.c~ b/2.3-1/src/c/matrixOperations/transpose/u16transposea.c~ new file mode 100644 index 00000000..33b35ecb --- /dev/null +++ b/2.3-1/src/c/matrixOperations/transpose/u16transposea.c~ @@ -0,0 +1,27 @@ +/* + * 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 "matrixTranspose.h" + +void u16transposea ( uint16* in , int lines , int columns, uint16* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (uint16)in[i+j*lines]; + } + +} diff --git a/2.3-1/src/c/matrixOperations/transpose/u8transposea.c b/2.3-1/src/c/matrixOperations/transpose/u8transposea.c new file mode 100644 index 00000000..2d0dd743 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/transpose/u8transposea.c @@ -0,0 +1,27 @@ +/* + * 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 "matrixTranspose.h" + +void u8transposea ( uint8* in , int lines , int columns, uint8* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (uint8)in[i+j*lines]; + } + +} diff --git a/2.3-1/src/c/matrixOperations/transpose/u8transposea.c~ b/2.3-1/src/c/matrixOperations/transpose/u8transposea.c~ new file mode 100644 index 00000000..2d0dd743 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/transpose/u8transposea.c~ @@ -0,0 +1,27 @@ +/* + * 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 "matrixTranspose.h" + +void u8transposea ( uint8* in , int lines , int columns, uint8* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (uint8)in[i+j*lines]; + } + +} diff --git a/2.3-1/src/c/operations/division/cldiva.c b/2.3-1/src/c/operations/division/cldiva.c index 21d95e31..73b94f28 100644 --- a/2.3-1/src/c/operations/division/cldiva.c +++ b/2.3-1/src/c/operations/division/cldiva.c @@ -15,7 +15,8 @@ void cldiva (floatComplex* in1, floatComplex* in2, int size, floatComplex* out ){ int i=0; - for (i=0;i<size;i++){ + for (i=0;i<size;i++) + { out[i]=cldivs(in1[i],in2[i]); } } diff --git a/2.3-1/src/c/operations/division/cldiva.c~ b/2.3-1/src/c/operations/division/cldiva.c~ new file mode 100644 index 00000000..73b94f28 --- /dev/null +++ b/2.3-1/src/c/operations/division/cldiva.c~ @@ -0,0 +1,22 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void cldiva (floatComplex* in1, floatComplex* in2, int size, floatComplex* out ){ + int i=0; + for (i=0;i<size;i++) + { + out[i]=cldivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/crdiva.c b/2.3-1/src/c/operations/division/crdiva.c index 86676bd5..ea9781e8 100644 --- a/2.3-1/src/c/operations/division/crdiva.c +++ b/2.3-1/src/c/operations/division/crdiva.c @@ -15,7 +15,8 @@ void crdiva (floatComplex* in1, floatComplex* in2, int size, floatComplex* out ){ int i=0; - for (i=0;i<size;i++){ + for (i=0;i<size;i++) + { out[i]=crdivs(in1[i],in2[i]); } } diff --git a/2.3-1/src/c/operations/division/crdiva.c~ b/2.3-1/src/c/operations/division/crdiva.c~ new file mode 100644 index 00000000..ea9781e8 --- /dev/null +++ b/2.3-1/src/c/operations/division/crdiva.c~ @@ -0,0 +1,22 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void crdiva (floatComplex* in1, floatComplex* in2, int size, floatComplex* out ){ + int i=0; + for (i=0;i<size;i++) + { + out[i]=crdivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/i16ldiva.c b/2.3-1/src/c/operations/division/i16ldiva.c new file mode 100644 index 00000000..a89aa69d --- /dev/null +++ b/2.3-1/src/c/operations/division/i16ldiva.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void i16ldiva (int16* in1, int16* in2, int size, int16* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i16ldivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/i16ldiva.c~ b/2.3-1/src/c/operations/division/i16ldiva.c~ new file mode 100644 index 00000000..a89aa69d --- /dev/null +++ b/2.3-1/src/c/operations/division/i16ldiva.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void i16ldiva (int16* in1, int16* in2, int size, int16* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i16ldivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/i16rdiva.c b/2.3-1/src/c/operations/division/i16rdiva.c new file mode 100644 index 00000000..ad7672c2 --- /dev/null +++ b/2.3-1/src/c/operations/division/i16rdiva.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void i16rdiva (int16* in1, int16* in2, int size, int16* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i16rdivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/i16rdiva.c~ b/2.3-1/src/c/operations/division/i16rdiva.c~ new file mode 100644 index 00000000..ad7672c2 --- /dev/null +++ b/2.3-1/src/c/operations/division/i16rdiva.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void i16rdiva (int16* in1, int16* in2, int size, int16* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i16rdivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/i8ldiva.c b/2.3-1/src/c/operations/division/i8ldiva.c new file mode 100644 index 00000000..0f471171 --- /dev/null +++ b/2.3-1/src/c/operations/division/i8ldiva.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void i8ldiva (int8* in1, int8* in2, int size, int8* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i8ldivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/i8ldiva.c~ b/2.3-1/src/c/operations/division/i8ldiva.c~ new file mode 100644 index 00000000..0f471171 --- /dev/null +++ b/2.3-1/src/c/operations/division/i8ldiva.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void i8ldiva (int8* in1, int8* in2, int size, int8* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i8ldivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/i8rdiva.c b/2.3-1/src/c/operations/division/i8rdiva.c new file mode 100644 index 00000000..0e6b217a --- /dev/null +++ b/2.3-1/src/c/operations/division/i8rdiva.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void i8rdiva (int8* in1, int8* in2, int size, int8* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i8rdivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/i8rdiva.c~ b/2.3-1/src/c/operations/division/i8rdiva.c~ new file mode 100644 index 00000000..0e6b217a --- /dev/null +++ b/2.3-1/src/c/operations/division/i8rdiva.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void i8rdiva (int8* in1, int8* in2, int size, int8* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i8rdivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/u16ldiva.c b/2.3-1/src/c/operations/division/u16ldiva.c new file mode 100644 index 00000000..55d3222e --- /dev/null +++ b/2.3-1/src/c/operations/division/u16ldiva.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void u16ldiva (uint16* in1, uint16* in2, int size, uint16* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u16ldivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/u16ldiva.c~ b/2.3-1/src/c/operations/division/u16ldiva.c~ new file mode 100644 index 00000000..55d3222e --- /dev/null +++ b/2.3-1/src/c/operations/division/u16ldiva.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void u16ldiva (uint16* in1, uint16* in2, int size, uint16* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u16ldivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/u16rdiva.c b/2.3-1/src/c/operations/division/u16rdiva.c new file mode 100644 index 00000000..eb21be16 --- /dev/null +++ b/2.3-1/src/c/operations/division/u16rdiva.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void u16rdiva (uint16* in1, uint16* in2, int size, uint16* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u16rdivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/u16rdiva.c~ b/2.3-1/src/c/operations/division/u16rdiva.c~ new file mode 100644 index 00000000..eb21be16 --- /dev/null +++ b/2.3-1/src/c/operations/division/u16rdiva.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void u16rdiva (uint16* in1, uint16* in2, int size, uint16* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u16rdivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/u8ldiva.c b/2.3-1/src/c/operations/division/u8ldiva.c new file mode 100644 index 00000000..76e59ad2 --- /dev/null +++ b/2.3-1/src/c/operations/division/u8ldiva.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void u8ldiva (uint8* in1, uint8* in2, int size, uint8* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u8ldivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/u8ldiva.c~ b/2.3-1/src/c/operations/division/u8ldiva.c~ new file mode 100644 index 00000000..76e59ad2 --- /dev/null +++ b/2.3-1/src/c/operations/division/u8ldiva.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void u8ldiva (uint8* in1, uint8* in2, int size, uint8* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u8ldivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/u8rdiva .c~ b/2.3-1/src/c/operations/division/u8rdiva .c~ new file mode 100644 index 00000000..d1eb5c4b --- /dev/null +++ b/2.3-1/src/c/operations/division/u8rdiva .c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void u8rdiva (uint8* in1, uint8* in2, int size, uint8* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u8rdivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/u8rdiva.c b/2.3-1/src/c/operations/division/u8rdiva.c new file mode 100644 index 00000000..d1eb5c4b --- /dev/null +++ b/2.3-1/src/c/operations/division/u8rdiva.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void u8rdiva (uint8* in1, uint8* in2, int size, uint8* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u8rdivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/division/u8rdiva.c~ b/2.3-1/src/c/operations/division/u8rdiva.c~ new file mode 100644 index 00000000..d1eb5c4b --- /dev/null +++ b/2.3-1/src/c/operations/division/u8rdiva.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "division.h" + +void u8rdiva (uint8* in1, uint8* in2, int size, uint8* out ){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u8rdivs(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/includes/division.h b/2.3-1/src/c/operations/includes/division.h index eedf4a3f..ac2d1482 100644 --- a/2.3-1/src/c/operations/includes/division.h +++ b/2.3-1/src/c/operations/includes/division.h @@ -102,15 +102,47 @@ EXTERN_OPERATIONS doubleComplex zrdivs (doubleComplex in1, doubleComplex in2); */ EXTERN_OPERATIONS void zrdiva(doubleComplex* in1, doubleComplex* in2, int size, doubleComplex* out ); + +/* +** \brief Compute a right division element ways for uint8. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array = rows*columns. +** \param out : array that contains the division in1 ./ in2. +*/ +EXTERN_OPERATIONS void u8rdiva (uint8* in1, uint8* in2, int size, uint8* out ); + + + /* ** \brief Compute a right division for uint8. ** \param in1 : input uint8. ** \param in2 : input uint8. ** \return in1 / in2 = in1 ./ in2. */ + EXTERN_OPERATIONS uint8 u8rdivs (uint8 in1, uint8 in2); /* +** \brief Compute a right division element ways for uint16. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array = rows*columns. +** \param out : array that contains the division in1 ./ in2. +*/ +EXTERN_OPERATIONS void u16rdiva (uint16* in1, uint16* in2, int size, uint16* out ); + + +/* +** \brief Compute a right division element ways for int8. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array = rows*columns. +** \param out : array that contains the division in1 ./ in2. +*/ +EXTERN_OPERATIONS void i8rdiva (int8* in1, int8* in2, int size, int8* out ); + +/* ** \brief Compute a right division for int8. ** \param in1 : input int8. ** \param in2 : input int8. @@ -135,6 +167,16 @@ EXTERN_OPERATIONS uint16 u16rdivs (uint16 in1, uint16 in2); EXTERN_OPERATIONS int16 i16rdivs (int16 in1, int16 in2); /* +** \brief Compute a right division element ways for int16. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array = rows*columns. +** \param out : array that contains the division in1 ./ in2. +*/ +EXTERN_OPERATIONS void i16rdiva (int16* in1, int16* in2, int size, int16* out ); + + +/* ** LEFT DIVISION */ @@ -207,6 +249,15 @@ EXTERN_OPERATIONS doubleComplex zldivs (doubleComplex in1, doubleComplex in2); EXTERN_OPERATIONS void zldiva(doubleComplex* in1, doubleComplex* in2, int size, doubleComplex* out ); /* +** \brief Compute a left division element ways for uint8. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array = rows*columns. +** \param out : array that contains the division in1 .\ in2. +*/ +EXTERN_OPERATIONS void u8ldiva (uint8* in1, uint8* in2, int size, uint8* out ); + +/* ** \brief Compute a right division for uint8. ** \param in1 : input uint8. ** \param in2 : input uint8. @@ -215,6 +266,15 @@ EXTERN_OPERATIONS void zldiva(doubleComplex* in1, doubleComplex* in2, int size, EXTERN_OPERATIONS uint8 u8ldivs (uint8 in1, uint8 in2); /* +** \brief Compute a left division element ways for int8. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array = rows*columns. +** \param out : array that contains the division in1 .\ in2. +*/ +EXTERN_OPERATIONS void i8ldiva (int8* in1, int8* in2, int size, int8* out ); + +/* ** \brief Compute a right division for int8. ** \param in1 : input int8. ** \param in2 : input int8. @@ -223,6 +283,16 @@ EXTERN_OPERATIONS uint8 u8ldivs (uint8 in1, uint8 in2); EXTERN_OPERATIONS int8 i8ldivs (int8 in1, int8 in2); /* +** \brief Compute a left division element ways for uint16. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array = rows*columns. +** \param out : array that contains the division in1 .\ in2. +*/ +EXTERN_OPERATIONS void u16ldiva (uint16* in1, uint16* in2, int size, uint16* out ); + + +/* ** \brief Compute a right division for uint16. ** \param in1 : input uint16. ** \param in2 : input uint16. @@ -231,6 +301,16 @@ EXTERN_OPERATIONS int8 i8ldivs (int8 in1, int8 in2); EXTERN_OPERATIONS uint16 u16ldivs (uint16 in1, uint16 in2); /* +** \brief Compute a left division element ways for int16. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array = rows*columns. +** \param out : array that contains the division in1 .\ in2. +*/ +EXTERN_OPERATIONS void i16ldiva (int16* in1, int16* in2, int size, int16* out ); + + +/* ** \brief Compute a right division for int16. ** \param in1 : input int16. ** \param in2 : input int16. diff --git a/2.3-1/src/c/operations/includes/multiplication.h b/2.3-1/src/c/operations/includes/multiplication.h index 8b08d6df..32ea932b 100644 --- a/2.3-1/src/c/operations/includes/multiplication.h +++ b/2.3-1/src/c/operations/includes/multiplication.h @@ -142,6 +142,15 @@ EXTERN_OPERATIONS doubleComplex zmulzdv(doubleComplex *in1, double *in2, int siz EXTERN_OPERATIONS doubleComplex zmuldzv(double *in1, doubleComplex *in2, int size2); /* +** \brief Compute a multiplication element ways for uint8. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array. +** \param out : array that contains the multiplication = in1 .* in2. +*/ +EXTERN_OPERATIONS void u8mula(uint8 *in1, uint8 *in2, int size,uint8 * out); + +/* ** \brief Compute a multiplication with uint8. ** \param in1 : input uint8. ** \param in2 : input uint8. @@ -159,6 +168,15 @@ EXTERN_OPERATIONS uint8 u8muls(uint8 in1, uint8 in2); EXTERN_OPERATIONS uint8 u8mulv(uint8 *in1, uint8 *in2, int size2); /* +** \brief Compute a multiplication element ways for int8. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array. +** \param out : array that contains the multiplication = in1 .* in2. +*/ +EXTERN_OPERATIONS void i8mula(int8 *in1, int8 *in2, int size,int8 * out); + +/* ** \brief Compute a multiplication with int8. ** \param in1 : input int8. ** \param in2 : input int8. @@ -176,6 +194,15 @@ EXTERN_OPERATIONS int8 i8muls(int8 in1, int8 in2); EXTERN_OPERATIONS int8 i8mulv(int8 *in1, int8 *in2, int size2); /* +** \brief Compute a multiplication element ways for uint16. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array. +** \param out : array that contains the multiplication = in1 .* in2. +*/ +EXTERN_OPERATIONS void u16mula(uint16 *in1, uint16 *in2, int size,uint16 * out); + +/* ** \brief Compute a multiplication with uint16. ** \param in1 : input uint16. ** \param in2 : input uint16. @@ -193,6 +220,15 @@ EXTERN_OPERATIONS uint16 u16muls(uint16 in1, uint16 in2); EXTERN_OPERATIONS uint16 u16mulv(uint16 *in1, uint16 *in2, int size2); /* +** \brief Compute a multiplication element ways for int16. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array. +** \param out : array that contains the multiplication = in1 .* in2. +*/ +EXTERN_OPERATIONS void i16mula(int16 *in1, int16 *in2, int size,int16 * out); + +/* ** \brief Compute a multiplication with int16. ** \param in1 : input int16. ** \param in2 : input int16. diff --git a/2.3-1/src/c/operations/interfaces/int_OpDotBackSlash.h b/2.3-1/src/c/operations/interfaces/int_OpDotBackSlash.h index 5ba1af3d..220da8db 100644 --- a/2.3-1/src/c/operations/interfaces/int_OpDotBackSlash.h +++ b/2.3-1/src/c/operations/interfaces/int_OpDotBackSlash.h @@ -25,6 +25,14 @@ #define z0z0OpDotBackSlashz0(in1,in2) zldivs(in1,in2) +#define u80u80OpDotBackSlashu80(in1,in2) u8ldivs(in1,in2) + +#define u160u160OpDotBackSlashu160(in1,in2) u16ldivs(in1,in2) + +#define i80i80OpDotBackSlashi80(in1,in2) i8ldivs(in1,in2) + +#define i160i160OpDotBackSlashi160(in1,in2) i16ldivs(in1,in2) + #define s0c0OpDotBackSlashc0(in1,in2) cldivs(FloatComplex(in1,0),in2) #define c0s0OpDotBackSlashc0(in1,in2) cldivs(in1,FloatComplex(in2,0)) @@ -48,6 +56,19 @@ #define z0z2OpDotBackSlashz2(in1,in2,size,out) {int i;\ for(i=0;i<size[0]*size[1];i++) out[i]= zldivs(in1,in2[i]);} +#define u80u82OpDotBackSlashu82(in1,in2,size,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= u8ldivs(in1,in2[i]);} + +#define u160u162OpDotBackSlashu162(in1,in2,size,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= u16ldivs(in1,in2[i]);} + +#define i80i82OpDotBackSlashi82(in1,in2,size,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= i8ldivs(in1,in2[i]);} + +#define i160i162OpDotBackSlashi162(in1,in2,size,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= i16ldivs(in1,in2[i]);} + + #define s0c2OpDotBackSlashc2(in1,in2,size,out) c0c2OpDotBackSlashc2(FloatComplex(in1,0),in2,size,out) #define d0z2OpDotBackSlashz2(in1,in2,size,out) z0z2OpDotBackSlashz2(DoubleComplex(in1,0),in2,size,out) @@ -73,6 +94,20 @@ #define z2z0OpDotBackSlashz2(in1,size,in2,out) {int i;\ for(i=0;i<size[0]*size[1];i++) out[i]= zldivs(in1[i],in2);} +#define u82u80OpDotBackSlashu82(in1,size,in2,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= u8ldivs(in1[i],in2);} + +#define u162u160OpDotBackSlashu162(in1,size,in2,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= u16ldivs(in1[i],in2);} + +#define i82i80OpDotBackSlashi82(in1,size,in2,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= i8ldivs(in1[i],in2);} + +#define i162i160OpDotBackSlashi162(in1,size,in2,out) {int i;\ + for(i=0;i<size[0]*size[1];i++) out[i]= i16ldivs(in1[i],in2);} + + + #define s2c0OpDotBackSlashc2(in1,size,in2,out) {int i;\ for(i=0;i<size[0]*size[1];i++) out[i]= cldivs(FloatComplex(in1[i],0),in2);} @@ -91,6 +126,15 @@ #define c2c2OpDotBackSlashc2(in1,size1,in2,size2,out) cldiva(in1,in2,size2[0]*size2[1],out) +#define u82u82OpDotBackSlashu82(in1,size1,in2,size2,out) u8ldiva(in1,in2,size2[0]*size2[1],out) + +#define u162u162OpDotBackSlashu162(in1,size1,in2,size2,out) u16ldiva(in1,in2,size2[0]*size2[1],out) + +#define i82i82OpDotBackSlashi82(in1,size1,in2,size2,out) i8ldiva(in1,in2,size2[0]*size2[1],out) + +#define i162i162OpDotBackSlashi162(in1,size1,in2,size2,out) i16ldiva(in1,in2,size2[0]*size2[1],out) + + #define c2s2OpDotBackSlashc2(in1,size1,in2,size2,out) {int i;\ for(i=0;i<size1[0]*size2[1];i++) out[i]= cldivs(in1[i],FloatComplex(in2[i], 0));} diff --git a/2.3-1/src/c/operations/interfaces/int_OpDotSlash.h b/2.3-1/src/c/operations/interfaces/int_OpDotSlash.h index a6c57051..54f0c3a2 100644 --- a/2.3-1/src/c/operations/interfaces/int_OpDotSlash.h +++ b/2.3-1/src/c/operations/interfaces/int_OpDotSlash.h @@ -25,6 +25,14 @@ #define z0z0OpDotSlashz0(in1,in2) zrdivs(in1,in2) +#define u80u80OpDotSlashu80(in1,in2) u8rdivs(in1,in2) + +#define u160u160OpDotSlashu160(in1,in2) u16rdivs(in1,in2) + +#define i80i80OpDotSlashi80(in1,in2) i8rdivs(in1,in2) + +#define i160i60OpDotSlashi60(in1,in2) i16divs(in1,in2) + #define s0c0OpDotSlashc0(in1,in2) crdivs(FloatComplex(in1,0),in2) #define c0s0OpDotSlashc0(in1,in2) crdivs(in1,FloatComplex(in2,0)) @@ -52,6 +60,19 @@ #define z0z2OpDotSlashz2(in1,in2,size,out) {int i=0;\ for (i=0;i<size[0]*size[1];i++) out[i]=crdivs(in1,in2[i]);} +#define u80u82OpDotSlashu82(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]=in1/in2[i];} + +#define u160u162OpDotSlashu162(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]=in1/in2[i];} + +#define i80i82OpDotSlashi82(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]=in1/in2[i];} + +#define i160i162OpDotSlashi162(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i]=in1/in2[i];} + + #define s0c2OpDotSlashc2(in1,in2,size,out) c0c2OpDotSlashc2(FloatComplex(in1,0),in2,size,out) @@ -87,6 +108,19 @@ #define z2z0OpDotSlashz2(in1,size,in2,out) {int i=0;\ for (i=0;i<size[0]*size[1];i++) out[i]=zrdivs(in1[i],in2);} +#define u82u80OpDotSlashu82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++ out[i]=in[i]/in2);} + +#define u162u160OpDotSlashu162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++ out[i]=in[i]/in2);} + +#define i82i80OpDotSlashi82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++ out[i]=in[i]/in2);} + +#define i162i160OpDotSlashi162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++ out[i]=in[i]/in2);} + + #define s2c0OpDotSlashc2(in1,size,in2,out) {int i=0;\ for (i=0;i<size[0]*size[1];i++) out[i]=crdivs(FloatComplex(in1[i],0),in2);} @@ -113,6 +147,17 @@ #define z2z2OpDotSlashz2(in1,size1,in2,size2,out) zrdiva(in1,in2,size2[0]*size2[1],out) +#define u82u82OpDotSlashu82(in1,size1,in2,size2,out) u8rdiva(in1,in2,size2[0]*size2[1],out) + +#define u162u162OpDotSlashu162(in1,size1,in2,size2,out) u16rdiva(in1,in2,size2[0]*size2[1],out) + +#define i82i82OpDotSlashi82(in1,size1,in2,size2,out) i8rdiva(in1,in2,size2[0]*size2[1],out) + +#define i162i162OpDotSlashi162(in1,size1,in2,size2,out) i16rdiva(in1,in2,size2[0]*size2[1],out) + + + + #define c2s2OpDotSlashc2(in1,size1,in2,size2,out) {int i=0;\ for (i=0;i<size1[0]*size2[1];i++) out[i]=crdivs(in1[i],FloatComplex(in2[i],0));} diff --git a/2.3-1/src/c/operations/interfaces/int_OpDotStar.h b/2.3-1/src/c/operations/interfaces/int_OpDotStar.h index 22e09a92..4586e0c6 100644 --- a/2.3-1/src/c/operations/interfaces/int_OpDotStar.h +++ b/2.3-1/src/c/operations/interfaces/int_OpDotStar.h @@ -25,6 +25,14 @@ #define z0z0OpDotStarz0(in1,in2) zmuls(in1,in2) +#define u80u80OpDotStaru80(in1,in2) u8muls(in1,in2) + +#define u160u160OpDotStaru160(in1,in2) u16muls(in1,in2) + +#define i80i80OpDotStari80(in1,in2) i8muls(in1,in2) + +#define i160i60OpDotStari60(in1,in2) i16muls(in1,in2) + #define s0c0OpDotStarc0(in1,in2) cmuls(FloatComplex(in1,0),in2) #define c0s0OpDotStarc0(in1,in2) cmuls(in1,FloatComplex(in2,0)) @@ -48,6 +56,18 @@ #define z0z2OpDotStarz2(in1,in2,size,out) {int i=0;\ for(i=0;i<size[0]*size[1];i++) out[i]= zmuls(in1,in2[i]);} +#define u80u82OpDotStaru80(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i] = u8muls(in1,in2[i]);} + +#define u160u162OpDotStaru160(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i] = u16muls(in1,in2[i]);} + +#define i80i82OpDotStari80(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i] = i8muls(in1,in2[i]);} + +#define i160i162OpDotStari160(in1,in2,size,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i] = i16muls(in1,in2[i]);} + #define s0c2OpDotStarc2(in1,in2,size,out) c0c2OpDotStarc2(FloatComplex(in1,0),in2,size,out) #define d0z2OpDotStarz2(in1,in2,size,out) z0z2OpDotStarz2(DoubleComplex(in1,0),in2,size,out) @@ -73,6 +93,18 @@ #define z2z0OpDotStarz2(in1,size,in2,out) {int i=0;\ for(i=0;i<size[0]*size[1];i++) out[i]= zmuls(in1[i],in2);} +#define u82u80OpDotStaru82(in1,size,in2,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i] = u8muls(in[i],in2);} + +#define u162u160OpDotStaru162(in1,size,in2,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i] = u16muls(in[i],in2);} + +#define i82i80OpDotStari82(in1,size,in2,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i] = i8muls(in[i],in2);} + +#define i162i160OpDotStari162(in1,size,in2,out) {int i=0;\ + for(i=0;i<size[0]*size[1];i++) out[i] = i16muls(in[i],in2);} + #define s2c0OpDotStarc2(in1,size,in2,out) {int i=0;\ for(i=0;i<size[0]*size[1];i++) out[i]= cmuls(FloatComplex(in1[i],0),in2);} @@ -93,6 +125,14 @@ #define z2z2OpDotStarz2(in1,size1,in2,size2,out) zmula(in1,in2,size1[0]*size2[1],out) +#define u82u82OpDotStaru82(in1,size1,in2,size2,out) u8mula(in1,in2,size1[0]*size2[1],out) + +#define u162u162OpDotStaru162(in1,size1,in2,size2,out) u16mula(in1,in2,size1[0]*size2[1],out) + +#define i82i82OpDotStari82(in1,size1,in2,size2,out) i8mula(in1,in2,size1[0]*size2[1],out) + +#define i162i61OpDotStari162(in1,size1,in2,size2,out) i16mula(in1,in2,size1[0]*size2[1],out) + #define c2s2OpDotStarc2(in1,size1,in2,size2,out) {int i=0;\ for(i=0;i<size1[0]*size2[1];i++) out[i]= cmuls(in1[i],FloatComplex(in2[i],0));} diff --git a/2.3-1/src/c/operations/multiplication/dmula.c b/2.3-1/src/c/operations/multiplication/dmula.c index 976faacf..77c204a7 100644 --- a/2.3-1/src/c/operations/multiplication/dmula.c +++ b/2.3-1/src/c/operations/multiplication/dmula.c @@ -15,7 +15,8 @@ void dmula(double* in1, double* in2, int size, double* out){ int i=0; - for (i=0;i<size;i++){ + for (i=0;i<size;i++) + { out[i]=dmuls(in1[i],in2[i]); } } diff --git a/2.3-1/src/c/operations/multiplication/dmula.c~ b/2.3-1/src/c/operations/multiplication/dmula.c~ new file mode 100644 index 00000000..77c204a7 --- /dev/null +++ b/2.3-1/src/c/operations/multiplication/dmula.c~ @@ -0,0 +1,22 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "multiplication.h" + +void dmula(double* in1, double* in2, int size, double* out){ + int i=0; + for (i=0;i<size;i++) + { + out[i]=dmuls(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/multiplication/dmuls.c b/2.3-1/src/c/operations/multiplication/dmuls.c index 09e7fdf5..ac21ace0 100644 --- a/2.3-1/src/c/operations/multiplication/dmuls.c +++ b/2.3-1/src/c/operations/multiplication/dmuls.c @@ -13,6 +13,7 @@ #include "multiplication.h" -double dmuls(double in1, double in2){ +double dmuls(double in1, double in2) +{ return in1*in2; } diff --git a/2.3-1/src/c/operations/multiplication/dmuls.c~ b/2.3-1/src/c/operations/multiplication/dmuls.c~ new file mode 100644 index 00000000..ac21ace0 --- /dev/null +++ b/2.3-1/src/c/operations/multiplication/dmuls.c~ @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "multiplication.h" + +double dmuls(double in1, double in2) +{ + return in1*in2; +} diff --git a/2.3-1/src/c/operations/multiplication/i16mula.c b/2.3-1/src/c/operations/multiplication/i16mula.c new file mode 100644 index 00000000..b16378dd --- /dev/null +++ b/2.3-1/src/c/operations/multiplication/i16mula.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "multiplication.h" + +void i16mula(int16* in1, int16* in2, int size, int16* out){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i16muls(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/multiplication/i16mula.c~ b/2.3-1/src/c/operations/multiplication/i16mula.c~ new file mode 100644 index 00000000..b16378dd --- /dev/null +++ b/2.3-1/src/c/operations/multiplication/i16mula.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "multiplication.h" + +void i16mula(int16* in1, int16* in2, int size, int16* out){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i16muls(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/multiplication/i8mula.c b/2.3-1/src/c/operations/multiplication/i8mula.c new file mode 100644 index 00000000..4d27d628 --- /dev/null +++ b/2.3-1/src/c/operations/multiplication/i8mula.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "multiplication.h" + +void i8mula(int8* in1, int8* in2, int size, int8* out){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i8muls(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/multiplication/i8mula.c~ b/2.3-1/src/c/operations/multiplication/i8mula.c~ new file mode 100644 index 00000000..4d27d628 --- /dev/null +++ b/2.3-1/src/c/operations/multiplication/i8mula.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "multiplication.h" + +void i8mula(int8* in1, int8* in2, int size, int8* out){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i8muls(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/multiplication/u16mula.c b/2.3-1/src/c/operations/multiplication/u16mula.c new file mode 100644 index 00000000..b6563d22 --- /dev/null +++ b/2.3-1/src/c/operations/multiplication/u16mula.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "multiplication.h" + +void u16mula(uint16* in1, uint16* in2, int size, uint16* out){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u16muls(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/multiplication/u16mula.c~ b/2.3-1/src/c/operations/multiplication/u16mula.c~ new file mode 100644 index 00000000..b6563d22 --- /dev/null +++ b/2.3-1/src/c/operations/multiplication/u16mula.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "multiplication.h" + +void u16mula(uint16* in1, uint16* in2, int size, uint16* out){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u16muls(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/operations/multiplication/u8mula.c b/2.3-1/src/c/operations/multiplication/u8mula.c index 79d4330e..ff76fa75 100644 --- a/2.3-1/src/c/operations/multiplication/u8mula.c +++ b/2.3-1/src/c/operations/multiplication/u8mula.c @@ -16,6 +16,6 @@ void u8mula(uint8* in1, uint8* in2, int size, uint8* out){ int i=0; for (i=0;i<size;i++){ - out[i]=dmuls(in1[i],in2[i]); + out[i]=u8muls(in1[i],in2[i]); } } diff --git a/2.3-1/src/c/operations/multiplication/u8mula.c~ b/2.3-1/src/c/operations/multiplication/u8mula.c~ new file mode 100644 index 00000000..ff76fa75 --- /dev/null +++ b/2.3-1/src/c/operations/multiplication/u8mula.c~ @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * 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 "multiplication.h" + +void u8mula(uint8* in1, uint8* in2, int size, uint8* out){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u8muls(in1[i],in2[i]); + } +} diff --git a/2.3-1/src/c/statisticsFunctions/includes/statMax.h b/2.3-1/src/c/statisticsFunctions/includes/statMax.h index 3538bc1a..7ac659ce 100644 --- a/2.3-1/src/c/statisticsFunctions/includes/statMax.h +++ b/2.3-1/src/c/statisticsFunctions/includes/statMax.h @@ -12,30 +12,60 @@ #ifndef __STAT_MAX_H__ #define __STAT_MAX_H__ - +//#ifndef __MAX_H__ +//#define __MAX_H__ #include "dynlib_statisticsfunctions.h" +#include "types.h" #ifdef __cplusplus extern "C" { #endif +#define max(a,b) (a>=b?a:b) + +#define maxa(a,size1,b,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=max(a[i],b[i]);\ + } + /* -** \brief Sum of a scalar element, just returns it +** \brief max of a scalar element, just returns it */ -#define smaxs(in) in +#define smaxs(in) in #define srowmaxs(in) in #define scolumnmaxs(in) in #define smatlabmaxs(in) in /* -** \brief Sum of a scalar element, just returns it +** \brief max of a scalar element, just returns it */ -#define dmaxs(in) in +#define dmaxs(in) in #define drowmaxs(in) in #define dcolumnmaxs(in) in #define dmatlabmaxs(in) in /* +** \brief max of a scalar element, just returns it +*/ +#define u8maxs(in) (uint8)in +#define u8rowmaxs(in) (uint8)in +#define u8columnmaxs(in) (uint8)in +#define u8matlabmaxs(in) (uint8)in +#define u16maxs(in) (uint16)in +#define u16rowmaxs(in) (uint16)in +#define u16columnmaxs(in) (uint16)in +#define u16matlabmaxs(in) (uint16)in +#define i8maxs(in) (int8)in +#define i8rowmaxs(in) (int8)in +#define i8columnmaxs(in) (int8)in +#define i8matlabmaxs(in) (int8)in +#define i16maxs(in) (int16)in +#define i16rowmaxs(in) (int16)in +#define i16columnmaxs(in) (int16)in +#define i16matlabmaxs(in) (int16)in + + + +/* ** \brief Sum of a float array ** \param in the float array to process ** \param size, the size of the array @@ -55,9 +85,47 @@ EXTERN_STATFUNC double dmaxa(double *in, int size); EXTERN_STATFUNC void drowmaxa(double *in, int lines, int columns, double* out); EXTERN_STATFUNC void dcolumnmaxa(double *in, int lines, int columns, double* out); +/* +** \brief Sum of a uint8 array +** \param in the uint8 array to process +** \param size, the size of the array +** \returns the max. +*/ +EXTERN_STATFUNC uint8 u8maxa(uint8 *in, int size); +EXTERN_STATFUNC void u8rowmaxa(uint8 *in, int lines, int columns, uint8* out); +EXTERN_STATFUNC void u8columnmaxa(uint8 *in, int lines, int columns, uint8* out); + +/* +** \brief Sum of a uint16 array +** \param in the uint16 array to process +** \param size, the size of the array +** \returns the max. +*/ +EXTERN_STATFUNC uint16 u16maxa(uint16 *in, int size); +EXTERN_STATFUNC void u16rowmaxa(uint16 *in, int lines, int columns, uint16* out); +EXTERN_STATFUNC void u16columnmaxa(uint16 *in, int lines, int columns, uint16* out); + +/* +** \brief Sum of a int8 array +** \param in the int8 array to process +** \param size, the size of the array +** \returns the max. +*/ +EXTERN_STATFUNC int8 i8maxa(int8 *in, int size); +EXTERN_STATFUNC void i8rowmaxa(int8 *in, int lines, int columns, int8* out); +EXTERN_STATFUNC void i8columnmaxa(int8 *in, int lines, int columns, int8* out); + +/* +** \brief Sum of a int16 array +** \param in the int16 array to process +** \param size, the size of the array +** \returns the max. +*/ +EXTERN_STATFUNC int16 i16maxa(int16 *in, int size); +EXTERN_STATFUNC void i16rowmaxa(int16 *in, int lines, int columns, int16* out); +EXTERN_STATFUNC void i16columnmaxa(int16 *in, int lines, int columns, int16* out); + #ifdef __cplusplus } /* extern "C" */ #endif - - #endif /* !__STAT_MAX_H__ */ diff --git a/2.3-1/src/c/statisticsFunctions/includes/statMin.h b/2.3-1/src/c/statisticsFunctions/includes/statMin.h index 9528d9f4..4381abd1 100644 --- a/2.3-1/src/c/statisticsFunctions/includes/statMin.h +++ b/2.3-1/src/c/statisticsFunctions/includes/statMin.h @@ -12,30 +12,60 @@ #ifndef __STAT_MIN_H__ #define __STAT_MIN_H__ - +//#ifndef __MIN_H__ +//#define __MIN_H__ #include "dynlib_statisticsfunctions.h" +#include "types.h" #ifdef __cplusplus extern "C" { #endif +#define min(a,b) (a<=b?a:b) + +#define mina(a,size1,b,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=min(a[i],b[i]);\ + } + /* -** \brief Sum of a scalar element, just returns it +** \brief min of a scalar element, just returns it */ #define smins(in) in #define srowmins(in) in -#define scolumnmins(in) in +#define scolumnmins(in) in #define smatlabmins(in) in /* -** \brief Sum of a scalar element, just returns it +** \brief min of a scalar element, just returns it */ #define dmins(in) in #define drowmins(in) in -#define dcolumnmins(in) in +#define dcolumnmins(in) in #define dmatlabmins(in) in /* +** \brief min of a scalar element, just returns it +*/ +#define u8mins(in) (uint8)in +#define u8rowmins(in) (uint8)in +#define u8columnmins(in) (uint8)in +#define u8matlabmins(in) (uint8)in +#define u16mins(in) (uint16)in +#define u16rowmins(in) (uint16)in +#define u16columnmins(in) (uint16)in +#define u16matlabmins(in) (uint16)in +#define i8mins(in) (int8)in +#define i8rowmins(in) (int8)in +#define i8columnmins(in) (int8)in +#define i8matlabmins(in) (int8)in +#define i16mins(in) (int16)in +#define i16rowmins(in) (int16)in +#define i16columnmins(in) (int16)in +#define i16matlabmins(in) (int16)in + + + +/* ** \brief Sum of a float array ** \param in the float array to process ** \param size, the size of the array @@ -55,9 +85,47 @@ EXTERN_STATFUNC double dmina(double *in, int size); EXTERN_STATFUNC void drowmina(double *in, int lines, int columns, double* out); EXTERN_STATFUNC void dcolumnmina(double *in, int lines, int columns, double* out); +/* +** \brief Sum of a uint8 array +** \param in the uint8 array to process +** \param size, the size of the array +** \returns the min. +*/ +EXTERN_STATFUNC uint8 u8mina(uint8 *in, int size); +EXTERN_STATFUNC void u8rowmina(uint8 *in, int lines, int columns, uint8* out); +EXTERN_STATFUNC void u8columnmina(uint8 *in, int lines, int columns, uint8* out); + +/* +** \brief Sum of a uint16 array +** \param in the uint16 array to process +** \param size, the size of the array +** \returns the min. +*/ +EXTERN_STATFUNC uint16 u16mina(uint16 *in, int size); +EXTERN_STATFUNC void u16rowmina(uint16 *in, int lines, int columns, uint16* out); +EXTERN_STATFUNC void u16columnmina(uint16 *in, int lines, int columns, uint16* out); + +/* +** \brief Sum of a int8 array +** \param in the int8 array to process +** \param size, the size of the array +** \returns the min. +*/ +EXTERN_STATFUNC int8 i8mina(int8 *in, int size); +EXTERN_STATFUNC void i8rowmina(int8 *in, int lines, int columns, int8* out); +EXTERN_STATFUNC void i8columnmina(int8 *in, int lines, int columns, int8* out); + +/* +** \brief Sum of a int16 array +** \param in the int16 array to process +** \param size, the size of the array +** \returns the min. +*/ +EXTERN_STATFUNC int16 i16mina(int16 *in, int size); +EXTERN_STATFUNC void i16rowmina(int16 *in, int lines, int columns, int16* out); +EXTERN_STATFUNC void i16columnmina(int16 *in, int lines, int columns, int16* out); + #ifdef __cplusplus } /* extern "C" */ #endif - - #endif /* !__STAT_MIN_H__ */ diff --git a/2.3-1/src/c/statisticsFunctions/interfaces/int_statMax.h b/2.3-1/src/c/statisticsFunctions/interfaces/int_statMax.h new file mode 100644 index 00000000..6d28186b --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/interfaces/int_statMax.h @@ -0,0 +1,161 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_STATMAX_H__ +#define __INT_STATMAX_H__ +//#ifndef __INT_MAX_H__ +//#define __INT_MAX_H__ + +#define s0maxs0(in) in + +#define d0maxd0(in) in + +#define u80maxu80(in) (uint8)in + +#define u160maxu160(in) (uint16)in + +#define i80maxi80(in) (int8)in + +#define i160maxi160(in) (int16)in + +#define s2maxs0(in,size) smaxa(in, size[0]*size[1]) + +#define d2maxd0(in,size) dmaxa(in, size[0]*size[1]) + +#define c2maxc0(in,size) cmaxa(in, size[0]*size[1]) + +#define z2maxz0(in,size) zmaxa(in, size[0]*size[1]) + +#define u82maxu80(in,size) u8maxa(in, size[0]*size[1]) + +#define u162maxu160(in,size) u16maxa(in, size[0]*size[1]) + +#define i82maxi80(in,size) i8maxa(in, size[0]*size[1]) + +#define i162maxi160(in,size) i16maxa(in, size[0]*size[1]) + + + +#define s0s0maxs0(in1,in2) max(in1,in2) + +#define d0d0maxd0(in1,in2) max(in1,in2) + +#define u80u80maxu80(in1,in2) max(in1,in2) + +#define u160u160maxu160(in1,in2) max(in1,in2) + +#define i80i80maxi80(in1,in2) max(in1,in2) + +#define i160i160maxi160(in1,in2) max(in1,in2) + +#define s2s2maxs2(in1,size1,in2,size2,out) maxa(in1, size1, in2, size2, out) + +#define d2d2maxd2(in1,size1,in2,size2,out) maxa(in1, size1, in2, size2, out) + +#define u82u82maxu82(in1,size1,in2,size2,out) maxa(in1, size1, in2, size2, out) + +#define u162u162maxu162(in1,size1,in2,size2,out) maxa(in1, size1, in2, size2, out) + +#define i82i82maxi82(in1,size1,in2,size2,out) maxa(in1, size1, in2, size2, out) + +#define i162i162maxi162(in1,size1,in2,size2,out) maxa(in1, size1, in2, size2, out) + + +#define s2s0maxs2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1[i],in2);\ + } + +#define d2d0maxd2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1[i],in2);\ + } + +#define u82u80maxu82(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1[i],in2);\ + } + +#define u162u160maxu162(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1[i],in2);\ + } + +#define i82i80maxi82(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1[i],in2);\ + } + +#define i162i160maxi162(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1[i],in2);\ + } + +#define s0s2maxs2(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1,in2[i]);\ + } + +#define d0d2maxd2(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1,in2[i]);\ + } + +#define u80u82maxu82(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1,in2[i]);\ + } + +#define u160u162maxu162(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1,in2[i]);\ + } + +#define i80i82maxi82(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1,in2[i]);\ + } + +#define i160i162maxi162(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=max(in1,in2[i]);\ + } + +/*'r' and 'c' case */ +#define s0g2maxs0(in1,in2,size2) (in2[0]=='r') ? srowmaxs(in1) : scolumnmaxs(in1) + +#define d0g2maxd0(in1,in2,size2) (in2[0]=='r') ? drowmaxs(in1) : dcolumnmaxs(in1) + +#define c0g2maxc0(in1,in2,size2) (in2[0]=='r') ? crowmaxs(in1) : ccolumnmaxs(in1) + +#define z0g2maxz0(in1,in2,size2) (in2[0]=='r') ? zrowmaxs(in1) : zcolumnmaxs(in1) + +#define u80g2maxu80(in1,in2,size2) (in2[0]=='r') ? u8rowmaxs(in1) : u8columnmaxs(in1) + +#define u160g2maxu160(in1,in2,size2) (in2[0]=='r') ? u16rowmaxs(in1) : u16columnmaxs(in1) + +#define i80g2maxi80(in1,in2,size2) (in2[0]=='r') ? i8rowmaxs(in1) : i8columnmaxs(in1) + +#define i160g2maxi160(in1,in2,size2) (in2[0]=='r') ? i16rowmaxs(in1) : i16columnmaxs(in1) + + +#define s2g2maxs2(in1,size1,in2,size2,out) (in2[0]=='r') ? srowmaxa(in1,size1[0],size1[1],out) : scolumnmaxa(in1,size1[0],size1[1],out) + +#define d2g2maxd2(in1,size1,in2,size2,out) (in2[0]=='r') ? drowmaxa(in1,size1[0],size1[1],out) : dcolumnmaxa(in1,size1[0],size1[1],out) + +#define c2g2maxc2(in1,size1,in2,size2,out) (in2[0]=='r') ? crowmaxa(in1,size1[0],size1[1],out) : ccolumnmaxa(in1,size1[0],size1[1],out) + +#define z2g2maxz2(in1,size1,in2,size2,out) (in2[0]=='r') ? zrowmaxa(in1,size1[0],size1[1],out) : zcolumnmaxa(in1,size1[0],size1[1],out) + +#define u82g2maxu82(in1,size1,in2,size2,out) (in2[0]=='r') ? u8rowmaxa(in1,size1[0],size1[1],out) : u8columnmaxa(in1,size1[0],size1[1],out) + +#define u162g2maxu162(in1,size1,in2,size2,out) (in2[0]=='r') ? u16rowmaxa(in1,size1[0],size1[1],out) : u16columnmaxa(in1,size1[0],size1[1],out) + +#define i82g2maxi82(in1,size1,in2,size2,out) (in2[0]=='r') ? i8rowmaxa(in1,size1[0],size1[1],out) : i8columnmaxa(in1,size1[0],size1[1],out) + +#define i162g2maxi162(in1,size1,in2,size2,out) (in2[0]=='r') ? i16rowmaxa(in1,size1[0],size1[1],out) : i16columnmaxa(in1,size1[0],size1[1],out) + + + + + +#endif /* !__INT_STATMAX_H__ */ diff --git a/2.3-1/src/c/statisticsFunctions/interfaces/int_statMin.h b/2.3-1/src/c/statisticsFunctions/interfaces/int_statMin.h new file mode 100644 index 00000000..39187efe --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/interfaces/int_statMin.h @@ -0,0 +1,162 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_STATMIN_H__ +#define __INT_STATMIN_H__ +//#ifndef __INT_MIN_H__ +//#define __INT_MIN_H__ + +#define s0mins0(in) in + +#define d0mind0(in) in + +#define u80minu80(in) (uint8)in + +#define u160minu160(in) (uint16)in + +#define i80mini80(in) (int8)in + +#define i160mini160(in) (int16)in + +#define s2mins0(in,size) smina(in, size[0]*size[1]) + +#define d2mind0(in,size) dmina(in, size[0]*size[1]) + +#define c2minc0(in,size) cmina(in, size[0]*size[1]) + +#define z2minz0(in,size) zmina(in, size[0]*size[1]) + +#define u82minu80(in,size) u8mina(in, size[0]*size[1]) + +#define u162minu160(in,size) u16mina(in, size[0]*size[1]) + +#define i82mini80(in,size) i8mina(in, size[0]*size[1]) + +#define i162mini160(in,size) i16mina(in, size[0]*size[1]) + + + +#define s0s0mins0(in1,in2) min(in1,in2) + +#define d0d0mind0(in1,in2) min(in1,in2) + +#define u80u80minu80(in1,in2) min(in1,in2) + +#define u160u160minu160(in1,in2) min(in1,in2) + +#define i80i80mini80(in1,in2) min(in1,in2) + +#define i160i160mini160(in1,in2) min(in1,in2) + +#define s2s2mins2(in1,size1,in2,size2,out) mina(in1, size1, in2, size2, out) + +#define d2d2mind2(in1,size1,in2,size2,out) mina(in1, size1, in2, size2, out) + +#define u82u82minu82(in1,size1,in2,size2,out) mina(in1, size1, in2, size2, out) + +#define u162u162minu162(in1,size1,in2,size2,out) mina(in1, size1, in2, size2, out) + +#define i82i82mini82(in1,size1,in2,size2,out) mina(in1, size1, in2, size2, out) + +#define i162i162mini162(in1,size1,in2,size2,out) mina(in1, size1, in2, size2, out) + + +#define s2s0mins2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1[i],in2);\ + } + +#define d2d0mind2(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1[i],in2);\ + } + +#define u82u80minu82(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1[i],in2);\ + } + +#define u162u160minu162(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1[i],in2);\ + } + +#define i82i80mini82(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1[i],in2);\ + } + +#define i162i160mini162(in1,size,in2,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1[i],in2);\ + } + +#define s0s2mins2(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1,in2[i]);\ + } + +#define d0d2mind2(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1,in2[i]);\ + } + +#define u80u82minu82(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1,in2[i]);\ + } + +#define u160u162minu162(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1,in2[i]);\ + } + +#define i80i82mini82(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1,in2[i]);\ + } + +#define i160i162mini162(in1,in2,size,out) {int i;\ + for (i=0;i<size[0]*size[1];i++) out[i]=min(in1,in2[i]);\ + } + + +/*'r' and 'c' case */ +#define s0g2mins0(in1,in2,size2) (in2[0]=='r') ? srowmins(in1) : scolumnmins(in1) + +#define d0g2mind0(in1,in2,size2) (in2[0]=='r') ? drowmins(in1) : dcolumnmins(in1) + +#define c0g2minc0(in1,in2,size2) (in2[0]=='r') ? crowmins(in1) : ccolumnmins(in1) + +#define z0g2minz0(in1,in2,size2) (in2[0]=='r') ? zrowmins(in1) : zcolumnmins(in1) + +#define u80g2minu80(in1,in2,size2) (in2[0]=='r') ? u8rowmins(in1) : u8columnmins(in1) + +#define u160g2minu160(in1,in2,size2) (in2[0]=='r') ? u16rowmins(in1) : u16columnmins(in1) + +#define i80g2mini80(in1,in2,size2) (in2[0]=='r') ? i8rowmins(in1) : i8columnmins(in1) + +#define i160g2mini160(in1,in2,size2) (in2[0]=='r') ? i16rowmins(in1) : i16columnmins(in1) + + +#define s2g2mins2(in1,size,in2,size2,out) (in2[0]=='r') ? srowmina(in1,size[0],size[1],out) : scolumnmina(in1,size[0],size[1],out) + +#define d2g2mind2(in1,size,in2,size2,out) (in2[0]=='r') ? drowmina(in1,size[0],size[1],out) : dcolumnmina(in1,size[0],size[1],out) + +#define c2g2minc2(in1,size,in2,size2,out) (in2[0]=='r') ? crowmina(in1,size[0],size[1],out) : ccolumnmina(in1,size[0],size[1],out) + +#define z2g2minz2(in1,size,in2,size2,out) (in2[0]=='r') ? zrowmina(in1,size[0],size[1],out) : zcolumnmina(in1,size[0],size[1],out) + +#define u82g2minu82(in1,size,in2,size2,out) (in2[0]=='r') ? u8rowmina(in1,size[0],size[1],out) : u8columnmina(in1,size[0],size[1],out) + +#define u162g2minu162(in1,size,in2,size2,out) (in2[0]=='r') ? u16rowmina(in1,size[0],size[1],out) : u16columnmina(in1,size[0],size[1],out) + +#define i82g2mini82(in1,size,in2,size2,out) (in2[0]=='r') ? i8rowmina(in1,size[0],size[1],out) : i8columnmina(in1,size[0],size[1],out) + +#define i162g2mini162(in1,size,in2,size2,out) (in2[0]=='r') ? i16rowmina(in1,size[0],size[1],out) : i16columnmina(in1,size[0],size[1],out) + + + + + +#endif /* !__INT_STATMIN_H__ */ diff --git a/2.3-1/src/c/statisticsFunctions/max/dcolumnmaxa.c b/2.3-1/src/c/statisticsFunctions/max/dcolumnmaxa.c index ae0bbd47..e66422a2 100644 --- a/2.3-1/src/c/statisticsFunctions/max/dcolumnmaxa.c +++ b/2.3-1/src/c/statisticsFunctions/max/dcolumnmaxa.c @@ -11,14 +11,16 @@ */ #include "statMax.h" +//#include "max.h" void dcolumnmaxa(double *in, int rows, int columns, double* out) { int i = 0, j = 0; for (i = 0; i < rows; i++) { - out[i]=in[i]; + out[i]=in[i*columns]; for (j=0;j<columns;j++) - if (in[i+j*rows]>out[i]) out[i] = in[i+j*rows]; + if (in[i+j*rows]>out[i]) + out[i] = in[i+j*rows]; } } diff --git a/2.3-1/src/c/statisticsFunctions/max/dcolumnmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/dcolumnmaxa.c~ new file mode 100644 index 00000000..e66422a2 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/dcolumnmaxa.c~ @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void dcolumnmaxa(double *in, int rows, int columns, double* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]>out[i]) + out[i] = in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/dmaxa.c b/2.3-1/src/c/statisticsFunctions/max/dmaxa.c index 5e2145e3..63644635 100644 --- a/2.3-1/src/c/statisticsFunctions/max/dmaxa.c +++ b/2.3-1/src/c/statisticsFunctions/max/dmaxa.c @@ -11,14 +11,15 @@ */ #include "statMax.h" - +//#include "max.h" double dmaxa(double *in, int size) { double out = in[0]; int i = 0; for (i = 1; i < size; ++i) { - if (in[i]>out) out = in[i]; + if (in[i]>out) + out = in[i]; } return out; diff --git a/2.3-1/src/c/statisticsFunctions/max/dmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/dmaxa.c~ new file mode 100644 index 00000000..931c0d2d --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/dmaxa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" +double dmaxa(double *in, int size) { + double out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) out = in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/drowmaxa.c b/2.3-1/src/c/statisticsFunctions/max/drowmaxa.c index a3099231..db0c72c0 100644 --- a/2.3-1/src/c/statisticsFunctions/max/drowmaxa.c +++ b/2.3-1/src/c/statisticsFunctions/max/drowmaxa.c @@ -11,13 +11,14 @@ */ #include "statMax.h" - +//#include "max.h" void drowmaxa(double *in, int rows, int columns, double* out) { int i = 0, j = 0; - - for (i = 0; i < columns; i++) { + for (i = 0; i < columns; i++) + { out[i]=in[i*rows]; for (j = 1 ; j < rows ; j++) - if (in[i*rows+j]>out[i]) out[i] = in[i*rows+j]; + if (in[i*rows+j]>out[i]) + out[i] = in[i*rows+j]; } } diff --git a/2.3-1/src/c/statisticsFunctions/max/drowmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/drowmaxa.c~ new file mode 100644 index 00000000..db0c72c0 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/drowmaxa.c~ @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" +void drowmaxa(double *in, int rows, int columns, double* out) { + int i = 0, j = 0; + for (i = 0; i < columns; i++) + { + out[i]=in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) + out[i] = in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i16columnmaxa.c b/2.3-1/src/c/statisticsFunctions/max/i16columnmaxa.c new file mode 100644 index 00000000..94c5cf6a --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i16columnmaxa.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" +void i16columnmaxa(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int16)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]>out[i]) + out[i] = (int16)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i16columnmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/i16columnmaxa.c~ new file mode 100644 index 00000000..94c5cf6a --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i16columnmaxa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" +void i16columnmaxa(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int16)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]>out[i]) + out[i] = (int16)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i16maxa.c b/2.3-1/src/c/statisticsFunctions/max/i16maxa.c new file mode 100644 index 00000000..c1294193 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i16maxa.c @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" +int16 i16maxa(int16 *in, int size) { + int16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (int16)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i16maxa.c~ b/2.3-1/src/c/statisticsFunctions/max/i16maxa.c~ new file mode 100644 index 00000000..c1294193 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i16maxa.c~ @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" +int16 i16maxa(int16 *in, int size) { + int16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (int16)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i16rowmaxa.c b/2.3-1/src/c/statisticsFunctions/max/i16rowmaxa.c new file mode 100644 index 00000000..263e56ca --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i16rowmaxa.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void i16rowmaxa(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int16)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) + out[i] = (int16)in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i16rowmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/i16rowmaxa.c~ new file mode 100644 index 00000000..263e56ca --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i16rowmaxa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void i16rowmaxa(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int16)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) + out[i] = (int16)in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i8columnmaxa.c b/2.3-1/src/c/statisticsFunctions/max/i8columnmaxa.c new file mode 100644 index 00000000..9c214dbb --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i8columnmaxa.c @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void i8columnmaxa(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int8)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]>out[i]) + out[i] = (int8)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i8columnmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/i8columnmaxa.c~ new file mode 100644 index 00000000..9c214dbb --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i8columnmaxa.c~ @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void i8columnmaxa(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int8)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]>out[i]) + out[i] = (int8)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i8maxa.c b/2.3-1/src/c/statisticsFunctions/max/i8maxa.c new file mode 100644 index 00000000..67fd3358 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i8maxa.c @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +int8 i8maxa(int8 *in, int size) { + int8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (int8)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i8maxa.c~ b/2.3-1/src/c/statisticsFunctions/max/i8maxa.c~ new file mode 100644 index 00000000..67fd3358 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i8maxa.c~ @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +int8 i8maxa(int8 *in, int size) { + int8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (int8)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i8rowmaxa.c b/2.3-1/src/c/statisticsFunctions/max/i8rowmaxa.c new file mode 100644 index 00000000..a6d15aa3 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i8rowmaxa.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void i8rowmaxa(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int8)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) + out[i] = (int8)in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/max/i8rowmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/i8rowmaxa.c~ new file mode 100644 index 00000000..a6d15aa3 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/i8rowmaxa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void i8rowmaxa(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int8)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) + out[i] = (int8)in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/max/scolumnmaxa.c b/2.3-1/src/c/statisticsFunctions/max/scolumnmaxa.c index 71af8460..4014f88a 100644 --- a/2.3-1/src/c/statisticsFunctions/max/scolumnmaxa.c +++ b/2.3-1/src/c/statisticsFunctions/max/scolumnmaxa.c @@ -11,12 +11,13 @@ */ #include "statMax.h" +//#include "max.h" void scolumnmaxa(float *in, int rows, int columns, float* out) { int i = 0, j = 0; for (i = 0; i < rows; i++) { - out[i]=in[i]; + out[i]=in[i*columns]; for (j=0;j<columns;j++) if (in[i+j*rows]>out[i]) out[i] = in[i+j*rows]; } diff --git a/2.3-1/src/c/statisticsFunctions/max/scolumnmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/scolumnmaxa.c~ new file mode 100644 index 00000000..4014f88a --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/scolumnmaxa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void scolumnmaxa(float *in, int rows, int columns, float* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]>out[i]) out[i] = in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/smaxa.c b/2.3-1/src/c/statisticsFunctions/max/smaxa.c index f47fcffe..03b4cf18 100644 --- a/2.3-1/src/c/statisticsFunctions/max/smaxa.c +++ b/2.3-1/src/c/statisticsFunctions/max/smaxa.c @@ -9,8 +9,8 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ - #include "statMax.h" +//#include "max.h" float smaxa(float *in, int size) { float out = in[0]; diff --git a/2.3-1/src/c/statisticsFunctions/max/smaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/smaxa.c~ new file mode 100644 index 00000000..03b4cf18 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/smaxa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +float smaxa(float *in, int size) { + float out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) out = in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/srowmaxa.c b/2.3-1/src/c/statisticsFunctions/max/srowmaxa.c index c87ccf7f..ea6c33d6 100644 --- a/2.3-1/src/c/statisticsFunctions/max/srowmaxa.c +++ b/2.3-1/src/c/statisticsFunctions/max/srowmaxa.c @@ -9,8 +9,8 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ - #include "statMax.h" +//#include "max.h" void srowmaxa(float *in, int rows, int columns, float* out) { int i = 0, j = 0; diff --git a/2.3-1/src/c/statisticsFunctions/max/srowmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/srowmaxa.c~ new file mode 100644 index 00000000..ea6c33d6 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/srowmaxa.c~ @@ -0,0 +1,23 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void srowmaxa(float *in, int rows, int columns, float* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) out[i] = in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/max/testDoubleMax.c b/2.3-1/src/c/statisticsFunctions/max/testDoubleMax.c index 81c50324..883b427f 100644 --- a/2.3-1/src/c/statisticsFunctions/max/testDoubleMax.c +++ b/2.3-1/src/c/statisticsFunctions/max/testDoubleMax.c @@ -11,8 +11,8 @@ */ - #include "statMax.h" +//#include "max.h" #include "assert.h" #include "stdio.h" diff --git a/2.3-1/src/c/statisticsFunctions/max/testDoubleMax.c~ b/2.3-1/src/c/statisticsFunctions/max/testDoubleMax.c~ new file mode 100644 index 00000000..883b427f --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/testDoubleMax.c~ @@ -0,0 +1,93 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "statMax.h" +//#include "max.h" +#include "assert.h" +#include "stdio.h" + + +static void dmaxaTest(void){ + double in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + double out; + + out = dmaxa(in,12); + assert(out-7==0); + +} + + +static void drowmaxaTest(void){ + double in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + double result2[2]={7,5}; + double result3[3]={7,6,5}; + double result4[4]={7,6,4,5}; + double result6[6]={5,7,6,4,5,4}; + double out1[1],out2[2],out3[3],out4[4],out6[6],out12[12]; + int i; + + + drowmaxa(in,12,1,out1); + drowmaxa(in,6,2,out2); + drowmaxa(in,4,3,out3); + drowmaxa(in,3,4,out4); + drowmaxa(in,2,6,out6); + drowmaxa(in,1,12,out12); + + assert(out1[0]-7==0); + for (i=0;i<2;i++) assert(out2[i]-result2[i]==0); + for (i=0;i<3;i++) assert(out3[i]-result3[i]==0); + for (i=0;i<4;i++) assert(out4[i]-result4[i]==0); + for (i=0;i<6;i++) assert(out6[i]-result6[i]==0); + for (i=0;i<12;i++) assert(out12[i]-in[i]==0); +} + + +static void dcolumnmaxaTest(void){ + double in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + double out1[1],out2[2],out3[3],out4[4],out6[6],out12[12]; + double result2[2]={7,6}; + double result3[3]={5,5,7}; + double result4[4]={4,6,7,3}; + double result6[6]={4,5,7,5,4,6}; + int i; + + + + dcolumnmaxa(in,12,1,out12); + dcolumnmaxa(in,6,2,out6); + dcolumnmaxa(in,4,3,out4); + dcolumnmaxa(in,3,4,out3); + dcolumnmaxa(in,2,6,out2); + dcolumnmaxa(in,1,12,out1); + + assert(out1[0]-7==0); + for (i=0;i<2;i++) assert(out2[i]-result2[i]==0); + for (i=0;i<3;i++) assert(out3[i]-result3[i]==0); + for (i=0;i<4;i++) assert(out4[i]-result4[i]==0); + for (i=0;i<6;i++) assert(out6[i]-result6[i]==0); + for (i=0;i<12;i++) assert(out12[i]-in[i]==0); +} + +static int maxTest(void){ + dmaxaTest(); + drowmaxaTest(); + dcolumnmaxaTest(); + return 0; +} + + +int main(void){ + assert(maxTest()==0); + return 0; +} diff --git a/2.3-1/src/c/statisticsFunctions/max/testFloatMax.c b/2.3-1/src/c/statisticsFunctions/max/testFloatMax.c index 7741aef4..cb572f7e 100644 --- a/2.3-1/src/c/statisticsFunctions/max/testFloatMax.c +++ b/2.3-1/src/c/statisticsFunctions/max/testFloatMax.c @@ -13,6 +13,7 @@ #include "statMax.h" +//#include "max.h" #include "assert.h" #include "stdio.h" diff --git a/2.3-1/src/c/statisticsFunctions/max/testFloatMax.c~ b/2.3-1/src/c/statisticsFunctions/max/testFloatMax.c~ new file mode 100644 index 00000000..cb572f7e --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/testFloatMax.c~ @@ -0,0 +1,93 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "statMax.h" +//#include "max.h" +#include "assert.h" +#include "stdio.h" + +static void smaxaTest(void){ + float in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + float out; + + out = smaxa(in,12); + assert(out-7==0); + +} + + +static void srowmaxaTest(void){ + float in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + float out1[1],out2[2],out3[3],out4[4],out6[6],out12[12]; + float result2[2]={7,5}; + float result3[3]={7,6,5}; + float result4[4]={7,6,4,5}; + float result6[6]={5,7,6,4,5,4}; + int i; + + + srowmaxa(in,12,1,out1); + srowmaxa(in,6,2,out2); + srowmaxa(in,4,3,out3); + srowmaxa(in,3,4,out4); + srowmaxa(in,2,6,out6); + srowmaxa(in,1,12,out12); + + assert(out1[0]-7==0); + for (i=0;i<2;i++) assert(out2[i]-result2[i]==0); + for (i=0;i<3;i++) assert(out3[i]-result3[i]==0); + for (i=0;i<4;i++) assert(out4[i]-result4[i]==0); + for (i=0;i<6;i++) assert(out6[i]-result6[i]==0); + for (i=0;i<12;i++) assert(out12[i]-in[i]==0); +} + + +static void scolumnmaxaTest(void){ + float in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + float out1[1],out2[2],out3[3],out4[4],out6[6],out12[12]; + float result2[2]={7,6}; + float result3[3]={5,5,7}; + float result4[4]={4,6,7,3}; + float result6[6]={4,5,7,5,4,6}; + int i; + + + + scolumnmaxa(in,12,1,out12); + scolumnmaxa(in,6,2,out6); + scolumnmaxa(in,4,3,out4); + scolumnmaxa(in,3,4,out3); + scolumnmaxa(in,2,6,out2); + scolumnmaxa(in,1,12,out1); + + assert(out1[0]-7==0); + for (i=0;i<2;i++) assert(out2[i]-result2[i]==0); + for (i=0;i<3;i++) assert(out3[i]-result3[i]==0); + for (i=0;i<4;i++) assert(out4[i]-result4[i]==0); + for (i=0;i<6;i++) assert(out6[i]-result6[i]==0); + for (i=0;i<12;i++) assert(out12[i]-in[i]==0); +} + +static int maxTest(void){ + smaxaTest(); + srowmaxaTest(); + scolumnmaxaTest(); + return 0; +} + + +int main(void){ + assert(maxTest()==0); + return 0; +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u16columnmaxa.c b/2.3-1/src/c/statisticsFunctions/max/u16columnmaxa.c new file mode 100644 index 00000000..e0ccb3ae --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u16columnmaxa.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" + +//#include "max.h" + +void u16columnmaxa(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + + + for (i = 0; i < rows; i++) { + out[i]=(uint16)in[i]; + for (j=0;j<columns;j++) + if (in[i+j*rows]>out[i]) + out[i] = (uint16)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u16columnmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/u16columnmaxa.c~ new file mode 100644 index 00000000..e0ccb3ae --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u16columnmaxa.c~ @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" + +//#include "max.h" + +void u16columnmaxa(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + + + for (i = 0; i < rows; i++) { + out[i]=(uint16)in[i]; + for (j=0;j<columns;j++) + if (in[i+j*rows]>out[i]) + out[i] = (uint16)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u16maxa.c b/2.3-1/src/c/statisticsFunctions/max/u16maxa.c new file mode 100644 index 00000000..c3af84f6 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u16maxa.c @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +uint16 u16maxa(uint16 *in, int size) { + uint16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (uint16)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u16maxa.c~ b/2.3-1/src/c/statisticsFunctions/max/u16maxa.c~ new file mode 100644 index 00000000..c881d88a --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u16maxa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +uint16 u16maxa(uint16 *in, int size) { + uint16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) out = (uint16)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u16rowmaxa.c b/2.3-1/src/c/statisticsFunctions/max/u16rowmaxa.c new file mode 100644 index 00000000..cef61f1d --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u16rowmaxa.c @@ -0,0 +1,29 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include <stdlib.h> +//#include "max.h" + +void u16rowmaxa(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + //out = malloc(columns*sizeof(uint16)); + for (i = 0; i < columns; i++) + { + out[i]=(uint16)in[i]; + for (j = 1 ; j < rows ; j++) + { + if (in[j*columns+i]>out[i]) + out[i] = (uint16)in[j*columns+i]; + } + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u16rowmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/u16rowmaxa.c~ new file mode 100644 index 00000000..7c6b6801 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u16rowmaxa.c~ @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +#include <stdlib.h> +//#include "max.h" + +void u16rowmaxa(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + for (i = 0; i < columns; i++) + { + out[i]=(uint16)in[i]; + for (j = 1 ; j < rows ; j++) + { + if (in[j*columns+i]>out[i]) + out[i] = (uint16)in[j*columns+i]; + } + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u8columnmaxa.c b/2.3-1/src/c/statisticsFunctions/max/u8columnmaxa.c new file mode 100644 index 00000000..222bc291 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u8columnmaxa.c @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void u8columnmaxa(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) +{ + out[i]=(uint8)in[0]; + for (j=0;j<columns;j++) + if (in[j]>out[i]) + out[i] = (uint8)in[j]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u8columnmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/u8columnmaxa.c~ new file mode 100644 index 00000000..e7f8f0ef --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u8columnmaxa.c~ @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void u8columnmaxa(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) + { + out[i]=(uint8)in[0]; + for (j=0;j<rows;j++) + if (in[j]>out[i]) + out[i] = (uint8)in[j]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u8maxa.c b/2.3-1/src/c/statisticsFunctions/max/u8maxa.c new file mode 100644 index 00000000..3e599150 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u8maxa.c @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" +uint8 u8maxa(uint8 *in, int size) { + uint8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (uint8)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u8maxa.c~ b/2.3-1/src/c/statisticsFunctions/max/u8maxa.c~ new file mode 100644 index 00000000..d9b6eca0 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u8maxa.c~ @@ -0,0 +1,27 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +uint8 u8maxa(uint8 *in, int size) { + uint8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (uint8)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u8rowmaxa.c b/2.3-1/src/c/statisticsFunctions/max/u8rowmaxa.c new file mode 100644 index 00000000..fda293c7 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u8rowmaxa.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void u8rowmaxa(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + + for (i = 0; i < columns; i++) + { + out[i]=(uint8)in[0]; + for (j = 0 ; j < rows ; j++) + { + if (in[j]>out[i]) + out[i] = (uint8)in[j]; + } + } +} diff --git a/2.3-1/src/c/statisticsFunctions/max/u8rowmaxa.c~ b/2.3-1/src/c/statisticsFunctions/max/u8rowmaxa.c~ new file mode 100644 index 00000000..fda293c7 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/max/u8rowmaxa.c~ @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMax.h" +//#include "max.h" + +void u8rowmaxa(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + + for (i = 0; i < columns; i++) + { + out[i]=(uint8)in[0]; + for (j = 0 ; j < rows ; j++) + { + if (in[j]>out[i]) + out[i] = (uint8)in[j]; + } + } +} diff --git a/2.3-1/src/c/statisticsFunctions/min/dcolumnmina.c b/2.3-1/src/c/statisticsFunctions/min/dcolumnmina.c index e12cb8ff..6f0b3c1a 100644 --- a/2.3-1/src/c/statisticsFunctions/min/dcolumnmina.c +++ b/2.3-1/src/c/statisticsFunctions/min/dcolumnmina.c @@ -16,7 +16,7 @@ void dcolumnmina(double *in, int rows, int columns, double* out) { int i = 0, j = 0; for (i = 0; i < rows; i++) { - out[i]=in[i]; + out[i]=in[i*columns]; for (j=0;j<columns;j++) if (in[i+j*rows]<out[i]) out[i] = in[i+j*rows]; } diff --git a/2.3-1/src/c/statisticsFunctions/min/dcolumnmina.c~ b/2.3-1/src/c/statisticsFunctions/min/dcolumnmina.c~ new file mode 100644 index 00000000..6f0b3c1a --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/dcolumnmina.c~ @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void dcolumnmina(double *in, int rows, int columns, double* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]<out[i]) out[i] = in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i16columnmina.c b/2.3-1/src/c/statisticsFunctions/min/i16columnmina.c new file mode 100644 index 00000000..d38b7b5d --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i16columnmina.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void i16columnmina(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int16)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]<out[i]) + out[i] = (int16)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i16columnmina.c~ b/2.3-1/src/c/statisticsFunctions/min/i16columnmina.c~ new file mode 100644 index 00000000..d38b7b5d --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i16columnmina.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void i16columnmina(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int16)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]<out[i]) + out[i] = (int16)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i16mina.c b/2.3-1/src/c/statisticsFunctions/min/i16mina.c new file mode 100644 index 00000000..6afdd5de --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i16mina.c @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +int16 i16mina(int16 *in, int size) { + int16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]<out) + out = (int16)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i16mina.c~ b/2.3-1/src/c/statisticsFunctions/min/i16mina.c~ new file mode 100644 index 00000000..6afdd5de --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i16mina.c~ @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +int16 i16mina(int16 *in, int size) { + int16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]<out) + out = (int16)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i16rowmina.c b/2.3-1/src/c/statisticsFunctions/min/i16rowmina.c new file mode 100644 index 00000000..adeeaaa4 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i16rowmina.c @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void i16rowmina(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int16)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]<out[i]) + out[i] = (int16)in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i16rowmina.c~ b/2.3-1/src/c/statisticsFunctions/min/i16rowmina.c~ new file mode 100644 index 00000000..adeeaaa4 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i16rowmina.c~ @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void i16rowmina(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int16)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]<out[i]) + out[i] = (int16)in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i8columnmina.c b/2.3-1/src/c/statisticsFunctions/min/i8columnmina.c new file mode 100644 index 00000000..1e97d621 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i8columnmina.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void i8columnmina(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int8)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]<out[i]) + out[i] = (int8)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i8columnmina.c~ b/2.3-1/src/c/statisticsFunctions/min/i8columnmina.c~ new file mode 100644 index 00000000..1e97d621 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i8columnmina.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void i8columnmina(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int8)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]<out[i]) + out[i] = (int8)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i8mina.c b/2.3-1/src/c/statisticsFunctions/min/i8mina.c new file mode 100644 index 00000000..07e8a108 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i8mina.c @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +int8 i8mina(int8 *in, int size) { + int8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]<out) + out = (int8)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i8mina.c~ b/2.3-1/src/c/statisticsFunctions/min/i8mina.c~ new file mode 100644 index 00000000..07e8a108 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i8mina.c~ @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +int8 i8mina(int8 *in, int size) { + int8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]<out) + out = (int8)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i8rowmina.c b/2.3-1/src/c/statisticsFunctions/min/i8rowmina.c new file mode 100644 index 00000000..4ce9edc5 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i8rowmina.c @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void i8rowmina(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int8)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]<out[i]) + out[i] = (int8)in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/min/i8rowmina.c~ b/2.3-1/src/c/statisticsFunctions/min/i8rowmina.c~ new file mode 100644 index 00000000..4ce9edc5 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/i8rowmina.c~ @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void i8rowmina(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int8)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]<out[i]) + out[i] = (int8)in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/min/scolumnmina.c b/2.3-1/src/c/statisticsFunctions/min/scolumnmina.c index 79fac41a..8e19b1de 100644 --- a/2.3-1/src/c/statisticsFunctions/min/scolumnmina.c +++ b/2.3-1/src/c/statisticsFunctions/min/scolumnmina.c @@ -16,7 +16,7 @@ void scolumnmina(float *in, int rows, int columns, float* out) { int i = 0, j = 0; for (i = 0; i < rows; i++) { - out[i]=in[i]; + out[i]=in[i*columns]; for (j=0;j<columns;j++) if (in[i+j*rows]<out[i]) out[i] = in[i+j*rows]; } diff --git a/2.3-1/src/c/statisticsFunctions/min/scolumnmina.c~ b/2.3-1/src/c/statisticsFunctions/min/scolumnmina.c~ new file mode 100644 index 00000000..8e19b1de --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/scolumnmina.c~ @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void scolumnmina(float *in, int rows, int columns, float* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]<out[i]) out[i] = in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u16columnmina.c b/2.3-1/src/c/statisticsFunctions/min/u16columnmina.c new file mode 100644 index 00000000..96c86a60 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u16columnmina.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void u16columnmina(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(uint16)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]<out[i]) + out[i] = (uint16)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u16columnmina.c~ b/2.3-1/src/c/statisticsFunctions/min/u16columnmina.c~ new file mode 100644 index 00000000..96c86a60 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u16columnmina.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void u16columnmina(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(uint16)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]<out[i]) + out[i] = (uint16)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u16mina.c b/2.3-1/src/c/statisticsFunctions/min/u16mina.c new file mode 100644 index 00000000..07c24eac --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u16mina.c @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +uint16 u16mina(uint16 *in, int size) { + uint16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]<out) + out = (uint16)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u16mina.c~ b/2.3-1/src/c/statisticsFunctions/min/u16mina.c~ new file mode 100644 index 00000000..07c24eac --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u16mina.c~ @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +uint16 u16mina(uint16 *in, int size) { + uint16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]<out) + out = (uint16)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u16rowmina.c b/2.3-1/src/c/statisticsFunctions/min/u16rowmina.c new file mode 100644 index 00000000..5180977e --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u16rowmina.c @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void u16rowmina(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(uint16)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]<out[i]) + out[i] = (uint16)in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u16rowmina.c~ b/2.3-1/src/c/statisticsFunctions/min/u16rowmina.c~ new file mode 100644 index 00000000..5180977e --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u16rowmina.c~ @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void u16rowmina(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(uint16)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]<out[i]) + out[i] = (uint16)in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u8columnmina.c b/2.3-1/src/c/statisticsFunctions/min/u8columnmina.c new file mode 100644 index 00000000..4ced0968 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u8columnmina.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void u8columnmina(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(uint8)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]<out[i]) + out[i] = (uint8)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u8columnmina.c~ b/2.3-1/src/c/statisticsFunctions/min/u8columnmina.c~ new file mode 100644 index 00000000..4ced0968 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u8columnmina.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void u8columnmina(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(uint8)in[i*columns]; + for (j=0;j<columns;j++) + if (in[i+j*rows]<out[i]) + out[i] = (uint8)in[i+j*rows]; + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u8mina.c b/2.3-1/src/c/statisticsFunctions/min/u8mina.c new file mode 100644 index 00000000..16a7bb4c --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u8mina.c @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +uint8 u8mina(uint8 *in, int size) { + uint8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]<out) + out = (uint8)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u8mina.c~ b/2.3-1/src/c/statisticsFunctions/min/u8mina.c~ new file mode 100644 index 00000000..16a7bb4c --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u8mina.c~ @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +uint8 u8mina(uint8 *in, int size) { + uint8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]<out) + out = (uint8)in[i]; + } + return out; + +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u8rowmina.c b/2.3-1/src/c/statisticsFunctions/min/u8rowmina.c new file mode 100644 index 00000000..ddbe274c --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u8rowmina.c @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void u8rowmina(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(uint8)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]<out[i]) + out[i] = (uint8)in[i*rows+j]; + } +} diff --git a/2.3-1/src/c/statisticsFunctions/min/u8rowmina.c~ b/2.3-1/src/c/statisticsFunctions/min/u8rowmina.c~ new file mode 100644 index 00000000..ddbe274c --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/min/u8rowmina.c~ @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "statMin.h" + +void u8rowmina(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(uint8)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]<out[i]) + out[i] = (uint8)in[i*rows+j]; + } +} |