diff options
author | yash1112 | 2017-07-07 21:20:49 +0530 |
---|---|---|
committer | yash1112 | 2017-07-07 21:20:49 +0530 |
commit | 3f52712f806fbd80d66dfdcaff401e5cf94dcca4 (patch) | |
tree | a8333b8187cb44b505b9fe37fc9a7ac8a1711c10 /src/c/statisticsFunctions/includes | |
download | Scilab2C_fossee_old-3f52712f806fbd80d66dfdcaff401e5cf94dcca4.tar.gz Scilab2C_fossee_old-3f52712f806fbd80d66dfdcaff401e5cf94dcca4.tar.bz2 Scilab2C_fossee_old-3f52712f806fbd80d66dfdcaff401e5cf94dcca4.zip |
sci2c arduino updated
Diffstat (limited to 'src/c/statisticsFunctions/includes')
-rw-r--r-- | src/c/statisticsFunctions/includes/dynlib_statisticsfunctions.h | 26 | ||||
-rw-r--r-- | src/c/statisticsFunctions/includes/mean.h | 99 | ||||
-rw-r--r-- | src/c/statisticsFunctions/includes/meanf.h | 106 | ||||
-rw-r--r-- | src/c/statisticsFunctions/includes/prod.h | 100 | ||||
-rw-r--r-- | src/c/statisticsFunctions/includes/statMax.h | 130 | ||||
-rw-r--r-- | src/c/statisticsFunctions/includes/statMin.h | 130 | ||||
-rw-r--r-- | src/c/statisticsFunctions/includes/stdevf.h | 129 | ||||
-rw-r--r-- | src/c/statisticsFunctions/includes/sum.h | 102 | ||||
-rw-r--r-- | src/c/statisticsFunctions/includes/variance.h | 117 | ||||
-rw-r--r-- | src/c/statisticsFunctions/includes/variancef.h | 117 |
10 files changed, 1056 insertions, 0 deletions
diff --git a/src/c/statisticsFunctions/includes/dynlib_statisticsfunctions.h b/src/c/statisticsFunctions/includes/dynlib_statisticsfunctions.h new file mode 100644 index 0000000..b6dab50 --- /dev/null +++ b/src/c/statisticsFunctions/includes/dynlib_statisticsfunctions.h @@ -0,0 +1,26 @@ +/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Allan CORNET
+*
+* 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
+*
+*/
+
+#ifndef __DYNLIB_STATISTICSFUNCTIONS_H__
+#define __DYNLIB_STATISTICSFUNCTIONS_H__
+
+#if defined(_MSC_VER) && defined(_USRDLL)
+ #if STATISTICSFUNCTIONS_EXPORTS
+ #define EXTERN_STATFUNC __declspec (dllexport)
+ #else
+ #define EXTERN_STATFUNC __declspec (dllimport)
+ #endif
+#else
+ #define EXTERN_STATFUNC
+#endif
+
+#endif /* __DYNLIB_STATISTICSFUNCTIONS_H__ */
diff --git a/src/c/statisticsFunctions/includes/mean.h b/src/c/statisticsFunctions/includes/mean.h new file mode 100644 index 0000000..d87c4ca --- /dev/null +++ b/src/c/statisticsFunctions/includes/mean.h @@ -0,0 +1,99 @@ +/* + * 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 + * + */ + +#ifndef __MEAN_H__ +#define __MEAN_H__ + +#include "dynlib_statisticsfunctions.h" +#include "division.h" +#include "addition.h" + +#ifdef __cplusplus +extern "C" { +#endif +/* +** \brief Mean of a scalar element, just returns it +*/ +#define smeans(in) in +#define srowmeans(in) in +#define scolumnmeans(in) in +#define smatlabmeans(in) in + +/* +** \brief Mean of a scalar element, just returns it +*/ +#define dmeans(in) in +#define drowmeans(in) in +#define dcolumnmeans(in) in +#define dmatlabmeans(in) in + +/* +** \brief Mean of a scalar element, just returns it +*/ +#define cmeans(in) in +#define crowmeans(in) in +#define ccolumnmeans(in) in +#define cmatlabmeans(in) in + +/* +** \brief Mean of a scalar element, just returns it +*/ +#define zmeans(in) in +#define zrowmeans(in) in +#define zcolumnmeans(in) in +#define zmatlabmeans(in) in + +/* +** \brief Mean of a float array +** \param in the float array to process +** \param size, the size of the array +** \returns the mean. +*/ +EXTERN_STATFUNC float smeana(float *in, int size); +EXTERN_STATFUNC void srowmeana(float *in, int lines, int columns, float* out); +EXTERN_STATFUNC void scolumnmeana(float *in, int lines, int columns, float* out); + +/* +** \brief Mean of a double array +** \param in the double array to process +** \param size, the size of the array +** \returns the mean. +*/ +EXTERN_STATFUNC double dmeana(double *in, int size); +EXTERN_STATFUNC void drowmeana(double *in, int lines, int columns, double* out); +EXTERN_STATFUNC void dcolumnmeana(double *in, int lines, int columns, double* out); + +/* +** \brief Mean of a float complex array +** \param in the float array to process +** \param size, the size of the array +** \returns the mean. +*/ +EXTERN_STATFUNC floatComplex cmeana(floatComplex *in, int size); +EXTERN_STATFUNC void crowmeana(floatComplex *in, int lines, int columns, floatComplex* out); +EXTERN_STATFUNC void ccolumnmeana(floatComplex *in, int lines, int columns, floatComplex* out); + +/* +** \brief Mean of a double complex array +** \param in the double array to process +** \param size, the size of the array +** \returns the mean. +*/ +EXTERN_STATFUNC doubleComplex zmeana(doubleComplex *in, int size); +EXTERN_STATFUNC void zrowmeana(doubleComplex *in, int lines, int columns, doubleComplex* out); +EXTERN_STATFUNC void zcolumnmeana(doubleComplex *in, int lines, int columns, doubleComplex* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__MEAN_H__ */ diff --git a/src/c/statisticsFunctions/includes/meanf.h b/src/c/statisticsFunctions/includes/meanf.h new file mode 100644 index 0000000..c0d687c --- /dev/null +++ b/src/c/statisticsFunctions/includes/meanf.h @@ -0,0 +1,106 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2009 - 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 + * + */ + +#ifndef __MEANF_H__ +#define __MEANF_H__ + +#include "dynlib_statisticsfunctions.h" +#include "division.h" +#include "addition.h" + +#ifdef __cplusplus +extern "C" { +#endif +/* +** \brief Meanf of a scalar element, just returns it +*/ +#define smeanfs(in1,in2) in1 +#define srowmeanfs(in1,in2) in1 +#define scolumnmeanfs(in1,in2) in1 +#define smatlabmeanfs(in1,in2) in1 + +/* +** \brief Meanf of a scalar element, just returns it +*/ +#define dmeanfs(in1,in2) in1 +#define drowmeanfs(in1,in2) in1 +#define dcolumnmeanfs(in1,in2) in1 +#define dmatlabmeanfs(in1,in2) in1 + +/* +** \brief Meanf of a scalar element, just returns it +*/ +#define cmeanfs(in1,in2) in1 +#define crowmeanfs(in1,in2) in1 +#define ccolumnmeanfs(in1,in2) in1 +#define cmatlabmeanfs(in1,in2) in1 + +/* +** \brief Meanf of a scalar element, just returns it +*/ +#define zmeanfs(in1,in2) in1 +#define zrowmeanfs(in1,in2) in1 +#define zcolumnmeanfs(in1,in2) in1 +#define zmatlabmeanfs(in1,in2) in1 + +/* +** \brief Meanf of a float array +** \param in the float array to process +** \param size, the size of the array +** \returns the meanf. +*/ +EXTERN_STATFUNC float smeanfa(float *in1, int size, float *in2); +EXTERN_STATFUNC void srowmeanfa(float *in1, int lines, int columns, float *in2, float* out); +EXTERN_STATFUNC void scolumnmeanfa(float *in1, int lines, int columns, float *in2, float* out); + +/* +** \brief Meanf of a double array +** \param in the double array to process +** \param size, the size of the array +** \returns the meanf. +*/ +EXTERN_STATFUNC double dmeanfa(double *in1, int size, double *in2); +EXTERN_STATFUNC void drowmeanfa(double *in1, int lines, int columns, double *in2, double* out); +EXTERN_STATFUNC void dcolumnmeanfa(double *in1, int lines, int columns, double *in2, double* out); + +/* +** \brief Meanf of a float complex array +** \param in the float array to process +** \param size, the size of the array +** \returns the meanf. +*/ +EXTERN_STATFUNC floatComplex cmeanfa(floatComplex *in1, int size, floatComplex *in2); +EXTERN_STATFUNC void crowmeanfa(floatComplex *in1, int lines, int columns, floatComplex *in2, floatComplex* out); +EXTERN_STATFUNC void ccolumnmeanfa(floatComplex *in1, int lines, int columns, floatComplex *in2, floatComplex* out); + +/* +** \brief Meanf of a double complex array +** \param in the double array to process +** \param size, the size of the array +** \returns the meanf. +*/ +EXTERN_STATFUNC doubleComplex zmeanfa(doubleComplex *in1, int size, doubleComplex *in2); +EXTERN_STATFUNC void zrowmeanfa(doubleComplex *in1, int lines, int columns, doubleComplex *in2, doubleComplex* out); +EXTERN_STATFUNC void zcolumnmeanfa(doubleComplex *in1, int lines, int columns, doubleComplex *in2, doubleComplex* out); + +/* for convenience with interface */ +doubleComplex zmeanfzd (doubleComplex* in1 ,int lines , int columns , double* in2); +doubleComplex zmeanfdz (double* in1 ,int lines , int columns , doubleComplex* in2); + +floatComplex cmeanfcs (floatComplex* in1 ,int lines , int columns , float* in2); +floatComplex cmeanfsc (float* in1 ,int lines , int columns , floatComplex* in2); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__MEAN_H__ */ diff --git a/src/c/statisticsFunctions/includes/prod.h b/src/c/statisticsFunctions/includes/prod.h new file mode 100644 index 0000000..a5fde84 --- /dev/null +++ b/src/c/statisticsFunctions/includes/prod.h @@ -0,0 +1,100 @@ +/* + * 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 + * + */ + +#ifndef __PROD_H__ +#define __PROD_H__ + +#include "dynlib_statisticsfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif +/* +** \brief Sum of a scalar element, just returns it +*/ +#define sprods(in) in +#define srowprods(in) in +#define scolumnprods(in) in +#define smatlabprods(in) in + +/* +** \brief Sum of a scalar element, just returns it +*/ +#define dprods(in) in +#define drowprods(in) in +#define dcolumnprods(in) in +#define dmatlabprods(in) in + +/* +** \brief Sum of a scalar element, just returns it +*/ +#define cprods(in) in +#define crowprods(in) in +#define ccolumnprods(in) in +#define cmatlabprods(in) in + +/* +** \brief Sum of a scalar element, just returns it +*/ +#define zprods(in) in +#define zrowprods(in) in +#define zcolumnprods(in) in +#define zmatlabprods(in) in + +/* +** \brief Sum of a float array +** \param in the float array to process +** \param size, the size of the array +** \returns the prod. +*/ +EXTERN_STATFUNC float sproda(float *in, int size); +EXTERN_STATFUNC void srowproda(float *in, int lines, int columns, float* out); +EXTERN_STATFUNC void scolumnproda(float *in, int lines, int columns, float* out); + +/* +** \brief Sum of a double array +** \param in the double array to process +** \param size, the size of the array +** \returns the prod. +*/ +EXTERN_STATFUNC double dproda(double *in, int size); +EXTERN_STATFUNC void drowproda(double *in, int lines, int columns, double* out); +EXTERN_STATFUNC void dcolumnproda(double *in, int lines, int columns, double* out); + +/* +** \brief Sum of a float complex array +** \param in the float array to process +** \param size, the size of the array +** \returns the prod. +*/ +EXTERN_STATFUNC floatComplex cproda(floatComplex *in, int size); +EXTERN_STATFUNC void crowproda(floatComplex *in, int lines, int columns, floatComplex* out); +EXTERN_STATFUNC void ccolumnproda(floatComplex *in, int lines, int columns, floatComplex* out); + +/* +** \brief Sum of a double complex array +** \param in the double array to process +** \param size, the size of the array +** \returns the prod. +*/ +EXTERN_STATFUNC doubleComplex zproda(doubleComplex *in, int size); +EXTERN_STATFUNC void zrowproda(doubleComplex *in, int lines, int columns, doubleComplex* out); +EXTERN_STATFUNC void zcolumnproda(doubleComplex *in, int lines, int columns, doubleComplex* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__PROD_H__ */ diff --git a/src/c/statisticsFunctions/includes/statMax.h b/src/c/statisticsFunctions/includes/statMax.h new file mode 100644 index 0000000..8e5d12b --- /dev/null +++ b/src/c/statisticsFunctions/includes/statMax.h @@ -0,0 +1,130 @@ +/* + * 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 + * + */ + +#ifndef __STAT_MAX_H__ +#define __STAT_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 max of a scalar element, just returns it +*/ +#define smaxs(in) in +#define srowmaxs(in) in +#define scolumnmaxs(in) in +#define smatlabmaxs(in) in + +/* +** \brief max of a scalar element, just returns it +*/ +#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 +** \returns the max. +*/ +EXTERN_STATFUNC float smaxa(float *in, int size); +EXTERN_STATFUNC void srowmaxa(float *in, int lines, int columns, float* out); +EXTERN_STATFUNC void scolumnmaxa(float *in, int lines, int columns, float* out); + +/* +** \brief Sum of a double array +** \param in the double array to process +** \param size, the size of the array +** \returns the max. +*/ +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/src/c/statisticsFunctions/includes/statMin.h b/src/c/statisticsFunctions/includes/statMin.h new file mode 100644 index 0000000..f3b8268 --- /dev/null +++ b/src/c/statisticsFunctions/includes/statMin.h @@ -0,0 +1,130 @@ +/* + * 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 + * + */ + +#ifndef __STAT_MIN_H__ +#define __STAT_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 min of a scalar element, just returns it +*/ +#define smins(in) in +#define srowmins(in) in +#define scolumnmins(in) in +#define smatlabmins(in) in + +/* +** \brief min of a scalar element, just returns it +*/ +#define dmins(in) in +#define drowmins(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 +** \returns the min. +*/ +EXTERN_STATFUNC float smina(float *in, int size); +EXTERN_STATFUNC void srowmina(float *in, int lines, int columns, float* out); +EXTERN_STATFUNC void scolumnmina(float *in, int lines, int columns, float* out); + +/* +** \brief Sum of a double array +** \param in the double array to process +** \param size, the size of the array +** \returns the min. +*/ +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/src/c/statisticsFunctions/includes/stdevf.h b/src/c/statisticsFunctions/includes/stdevf.h new file mode 100644 index 0000000..c9e4859 --- /dev/null +++ b/src/c/statisticsFunctions/includes/stdevf.h @@ -0,0 +1,129 @@ +/* + * 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 + * + */ + +#ifndef __STDEVF_H__ +#define __STDEVF_H__ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> + + +#include "dynlib_statisticsfunctions.h" +#include "subtraction.h" +#include "division.h" + + +#include "pow.h" +#include "sum.h" +#include "size.h" +#include "sqrt.h" +#include "meanf.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + + + + + +/* +** \brief Standard deviation of a scalar element, just returns it +*/ +#define sstdevfs(in1,in2) 0.0f +#define srowstdevfs(in1,in2) 0.0f +#define scolumnstdevfs(in1,in2) 0.0f + + +/* +** \brief Standard deviation of a scalar element, just returns it +*/ +#define dstdevfs(in1,in2) 0.0 +#define drowstdevfs(in1,in2) 0.0 +#define dcolumnstdevfs(in1,in2) 0.0 + + +/* +** \brief Standard deviation of a scalar element, just returns it +*/ +#define cstdevfs(in1,in2) FloatComplex(0.0f , 0.0f) +#define crowstdevfs(in1,in2) FloatComplex(0.0f , 0.0f) +#define ccolumnstdevfs(in1,in2) FloatComplex(0.0f , 0.0f) + + +/* +** \brief Standard deviation of a scalar element, just returns it +*/ +#define zstdevfs(in1,in2) DoubleComplex(0.0 , 0.0) +#define zrowstdevfs(in1,in2) DoubleComplex(0.0 , 0.0) +#define zcolumnstdevfs(in1,in2) DoubleComplex(0.0 , 0.0) + + +/* +** \brief Standard deviation of a float array +** \param in the float array to process +** \param size, the size of the array +** \returns the stdevf. +*/ +EXTERN_STATFUNC float sstdevfa(float *in1, int lines, int columns, float *in2); +EXTERN_STATFUNC void srowstdevfa(float *in1, int lines, int columns, float *in2, float* out); +EXTERN_STATFUNC void scolumnstdevfa(float *in1, int lines, int columns, float *in2, float* out); + +/* +** \brief Standard deviation of a double array +** \param in the double array to process +** \param size, the size of the array +** \returns the stdevf. +*/ +EXTERN_STATFUNC double dstdevfa(double *in1, int lines, int columns, double *in2); +EXTERN_STATFUNC void drowstdevfa(double *in1, int lines, int columns, double *in2, double* out); +EXTERN_STATFUNC void dcolumnstdevfa(double *in1, int lines, int columns, double *in2, double* out); + +/* +** \brief Standard deviation of a float complex array +** \param in the float array to process +** \param size, the size of the array +** \returns the stdevf. +*/ +EXTERN_STATFUNC floatComplex cstdevfa(floatComplex *in1, int lines, int columns, floatComplex *in2); +EXTERN_STATFUNC void crowstdevfa(floatComplex *in1, int lines, int columns, floatComplex *in2, floatComplex* out); +EXTERN_STATFUNC void ccolumnstdevfa(floatComplex *in1, int lines, int columns, floatComplex *in2, floatComplex* out); + +/* +** \brief Standard deviation of a double complex array +** \param in the double array to process +** \param size, the size of the array +** \returns the stdevf. +*/ +EXTERN_STATFUNC doubleComplex zstdevfa(doubleComplex *in1, int lines, int columns, doubleComplex *in2); +EXTERN_STATFUNC void zrowstdevfa(doubleComplex *in1, int lines, int columns, doubleComplex *in2, doubleComplex* out); +EXTERN_STATFUNC void zcolumnstdevfa(doubleComplex *in1, int lines, int columns, doubleComplex *in2, doubleComplex* out); + +/* +** convenience functions +*/ + +EXTERN_STATFUNC floatComplex cstdevfcs(floatComplex *in1, int lines, int columns, float *in2); +EXTERN_STATFUNC floatComplex cstdevfsc(float *in1, int lines, int columns, floatComplex *in2); + +EXTERN_STATFUNC doubleComplex zstdevfzd(doubleComplex *in1, int lines, int columns, double *in2); +EXTERN_STATFUNC doubleComplex zstdevfdz(double *in1, int lines, int columns, doubleComplex *in2); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__STDEVF_H__ */ diff --git a/src/c/statisticsFunctions/includes/sum.h b/src/c/statisticsFunctions/includes/sum.h new file mode 100644 index 0000000..2910792 --- /dev/null +++ b/src/c/statisticsFunctions/includes/sum.h @@ -0,0 +1,102 @@ +/* + * 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 + * + */ + +#ifndef __SUM_H__ +#define __SUM_H__ + +#include "dynlib_statisticsfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "addition.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** \brief Sum of a scalar element, just returns it +*/ +#define ssums(in) in +#define srowsums(in) in +#define scolumnsums(in) in +#define smatlabsums(in) in + +/* +** \brief Sum of a scalar element, just returns it +*/ +#define dsums(in) in +#define drowsums(in) in +#define dcolumnsums(in) in +#define dmatlabsums(in) in + +/* +** \brief Sum of a scalar element, just returns it +*/ +#define csums(in) in +#define crowsums(in) in +#define ccolumnsums(in) in +#define cmatlabsums(in) in + +/* +** \brief Sum of a scalar element, just returns it +*/ +#define zsums(in) in +#define zrowsums(in) in +#define zcolumnsums(in) in +#define zmatlabsums(in) in + +/* +** \brief Sum of a float array +** \param in the float array to process +** \param size, the size of the array +** \returns the sum. +*/ +EXTERN_STATFUNC float ssuma(float *in, int size); +EXTERN_STATFUNC void srowsuma(float *in, int lines, int columns, float* out); +EXTERN_STATFUNC void scolumnsuma(float *in, int lines, int columns, float* out); + +/* +** \brief Sum of a double array +** \param in the double array to process +** \param size, the size of the array +** \returns the sum. +*/ +EXTERN_STATFUNC double dsuma(double *in, int size); +EXTERN_STATFUNC void drowsuma(double *in, int lines, int columns, double* out); +EXTERN_STATFUNC void dcolumnsuma(double *in, int lines, int columns, double* out); + +/* +** \brief Sum of a float complex array +** \param in the float array to process +** \param size, the size of the array +** \returns the sum. +*/ +EXTERN_STATFUNC floatComplex csuma(floatComplex *in, int size); +EXTERN_STATFUNC void crowsuma(floatComplex *in, int lines, int columns, floatComplex* out); +EXTERN_STATFUNC void ccolumnsuma(floatComplex *in, int lines, int columns, floatComplex* out); + +/* +** \brief Sum of a double complex array +** \param in the double array to process +** \param size, the size of the array +** \returns the sum. +*/ +EXTERN_STATFUNC doubleComplex zsuma(doubleComplex *in, int size); +EXTERN_STATFUNC void zrowsuma(doubleComplex *in, int lines, int columns, doubleComplex* out); +EXTERN_STATFUNC void zcolumnsuma(doubleComplex *in, int lines, int columns, doubleComplex* out); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__SUM_H__ */ diff --git a/src/c/statisticsFunctions/includes/variance.h b/src/c/statisticsFunctions/includes/variance.h new file mode 100644 index 0000000..a058bb7 --- /dev/null +++ b/src/c/statisticsFunctions/includes/variance.h @@ -0,0 +1,117 @@ +/* + * 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 + * + */ + +#ifndef __VARIANCE_H__ +#define __VARIANCE_H__ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> + + +#include "dynlib_statisticsfunctions.h" +#include "subtraction.h" +#include "division.h" + +#include "pow.h" +#include "sum.h" + +#include "mean.h" +#include "matrixTranspose.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + + + + +/* +** \brief Variance of a scalar element, just returns it +*/ +#define svariances(in) in +#define srowvariances(in) in +#define scolumnvariances(in) in + + +/* +** \brief Variance of a scalar element, just returns it +*/ +#define dvariances(in) in +#define drowvariances(in) in +#define dcolumnvariances(in) in + + +/* +** \brief Variance of a scalar element, just returns it +*/ +#define cvariances(in) in +#define crowvariances(in) in +#define ccolumnvariances(in) in + + +/* +** \brief Variance of a scalar element, just returns it +*/ +#define zvariances(in) in +#define zrowvariances(in) in +#define zcolumnvariances(in) in + + +/* +** \brief Variance of a float array +** \param in the float array to process +** \param size, the size of the array +** \returns the variance. +*/ +EXTERN_STATFUNC float svariancea(float *in, int size); +EXTERN_STATFUNC void srowvariancea(float *in, int lines, int columns, float* out); +EXTERN_STATFUNC void scolumnvariancea(float *in, int lines, int columns, float* out); + +/* +** \brief Variance of a double array +** \param in the double array to process +** \param size, the size of the array +** \returns the variance. +*/ +EXTERN_STATFUNC double dvariancea(double *in, int size); +EXTERN_STATFUNC void drowvariancea(double *in, int lines, int columns, double* out); +EXTERN_STATFUNC void dcolumnvariancea(double *in, int lines, int columns, double* out); + +/* +** \brief Variance of a float complex array +** \param in the float array to process +** \param size, the size of the array +** \returns the variance. +*/ +EXTERN_STATFUNC floatComplex cvariancea(floatComplex *in, int size); +EXTERN_STATFUNC void crowvariancea(floatComplex *in, int lines, int columns, floatComplex* out); +EXTERN_STATFUNC void ccolumnvariancea(floatComplex *in, int lines, int columns, floatComplex* out); + +/* +** \brief Variance of a double complex array +** \param in the double array to process +** \param size, the size of the array +** \returns the variance. +*/ +EXTERN_STATFUNC doubleComplex zvariancea(doubleComplex *in, int size); +EXTERN_STATFUNC void zrowvariancea(doubleComplex *in, int lines, int columns, doubleComplex* out); +EXTERN_STATFUNC void zcolumnvariancea(doubleComplex *in, int lines, int columns, doubleComplex* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__VARIANCE_H__ */ diff --git a/src/c/statisticsFunctions/includes/variancef.h b/src/c/statisticsFunctions/includes/variancef.h new file mode 100644 index 0000000..e682a18 --- /dev/null +++ b/src/c/statisticsFunctions/includes/variancef.h @@ -0,0 +1,117 @@ +/* + * 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 + * + */ + +#ifndef __VARIANCEF_H__ +#define __VARIANCEF_H__ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> + + +#include "dynlib_statisticsfunctions.h" +#include "subtraction.h" +#include "division.h" + + +#include "pow.h" +#include "sum.h" + +#include "meanf.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + + + + +/* +** \brief Variance of a scalar element, just returns it +*/ +#define svariancefs(in1,in2) 0.0f +#define srowvariancefs(in1,in2) 0.0f +#define scolumnvariancefs(in1,in2) 0.0f + + +/* +** \brief Variance of a scalar element, just returns it +*/ +#define dvariancefs(in1,in2) 0.0 +#define drowvariancefs(in1,in2) 0.0 +#define dcolumnvariancefs(in1,in2) 0.0 + + +/* +** \brief Variance of a scalar element, just returns it +*/ +#define cvariancefs(in1,in2) FloatComplex(0.0f , 0.0f) +#define crowvariancefs(in1,in2) FloatComplex(0.0f , 0.0f) +#define ccolumnvariancefs(in1,in2) FloatComplex(0.0f , 0.0f) + + +/* +** \brief Variance of a scalar element, just returns it +*/ +#define zvariancefs(in1,in2) DoubleComplex(0.0 , 0.0) +#define zrowvariancefs(in1,in2) DoubleComplex(0.0 , 0.0) +#define zcolumnvariancefs(in1,in2) DoubleComplex(0.0 , 0.0) + + +/* +** \brief Variance of a float array +** \param in the float array to process +** \param size, the size of the array +** \returns the variancef. +*/ +EXTERN_STATFUNC float svariancefa(float *in1, int size, float *in2); +EXTERN_STATFUNC void srowvariancefa(float *in1, int lines, int columns, float *in2, float* out); +EXTERN_STATFUNC void scolumnvariancefa(float *in1, int lines, int columns, float *in2, float* out); + +/* +** \brief Variance of a double array +** \param in the double array to process +** \param size, the size of the array +** \returns the variancef. +*/ +EXTERN_STATFUNC double dvariancefa(double *in1, int size, double *in2); +EXTERN_STATFUNC void drowvariancefa(double *in1, int lines, int columns, double *in2, double* out); +EXTERN_STATFUNC void dcolumnvariancefa(double *in1, int lines, int columns, double *in2, double* out); + +/* +** \brief Variance of a float complex array +** \param in the float array to process +** \param size, the size of the array +** \returns the variancef. +*/ +EXTERN_STATFUNC floatComplex cvariancefa(floatComplex *in1, int size, floatComplex *in2); +EXTERN_STATFUNC void crowvariancefa(floatComplex *in1, int lines, int columns, floatComplex *in2, floatComplex* out); +EXTERN_STATFUNC void ccolumnvariancefa(floatComplex *in1, int lines, int columns, floatComplex *in2, floatComplex* out); + +/* +** \brief Variance of a double complex array +** \param in the double array to process +** \param size, the size of the array +** \returns the variancef. +*/ +EXTERN_STATFUNC doubleComplex zvariancefa(doubleComplex *in1, int size, doubleComplex *in2); +EXTERN_STATFUNC void zrowvariancefa(doubleComplex *in1, int lines, int columns, doubleComplex *in2, doubleComplex* out); +EXTERN_STATFUNC void zcolumnvariancefa(doubleComplex *in1, int lines, int columns, doubleComplex *in2, doubleComplex* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__VARIANCEF_H__ */ |