From a555820564d9f2e95ca8c97871339d3a5a2081c3 Mon Sep 17 00:00:00 2001 From: Ankit Raj Date: Wed, 21 Jun 2017 10:26:59 +0530 Subject: Updated Scilab2C --- .../includes/dynlib_statisticsfunctions.h | 26 +++++ 2.3-1/src/c/statisticsFunctions/includes/mean.h | 99 ++++++++++++++++ 2.3-1/src/c/statisticsFunctions/includes/meanf.h | 106 +++++++++++++++++ 2.3-1/src/c/statisticsFunctions/includes/prod.h | 100 ++++++++++++++++ 2.3-1/src/c/statisticsFunctions/includes/statMax.h | 130 +++++++++++++++++++++ 2.3-1/src/c/statisticsFunctions/includes/statMin.h | 130 +++++++++++++++++++++ 2.3-1/src/c/statisticsFunctions/includes/stdevf.h | 129 ++++++++++++++++++++ 2.3-1/src/c/statisticsFunctions/includes/sum.h | 102 ++++++++++++++++ .../src/c/statisticsFunctions/includes/variance.h | 117 +++++++++++++++++++ .../src/c/statisticsFunctions/includes/variancef.h | 117 +++++++++++++++++++ 10 files changed, 1056 insertions(+) create mode 100644 2.3-1/src/c/statisticsFunctions/includes/dynlib_statisticsfunctions.h create mode 100644 2.3-1/src/c/statisticsFunctions/includes/mean.h create mode 100644 2.3-1/src/c/statisticsFunctions/includes/meanf.h create mode 100644 2.3-1/src/c/statisticsFunctions/includes/prod.h create mode 100644 2.3-1/src/c/statisticsFunctions/includes/statMax.h create mode 100644 2.3-1/src/c/statisticsFunctions/includes/statMin.h create mode 100644 2.3-1/src/c/statisticsFunctions/includes/stdevf.h create mode 100644 2.3-1/src/c/statisticsFunctions/includes/sum.h create mode 100644 2.3-1/src/c/statisticsFunctions/includes/variance.h create mode 100644 2.3-1/src/c/statisticsFunctions/includes/variancef.h (limited to '2.3-1/src/c/statisticsFunctions/includes') diff --git a/2.3-1/src/c/statisticsFunctions/includes/dynlib_statisticsfunctions.h b/2.3-1/src/c/statisticsFunctions/includes/dynlib_statisticsfunctions.h new file mode 100644 index 00000000..b6dab50f --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/statisticsFunctions/includes/mean.h b/2.3-1/src/c/statisticsFunctions/includes/mean.h new file mode 100644 index 00000000..d87c4ca5 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/statisticsFunctions/includes/meanf.h b/2.3-1/src/c/statisticsFunctions/includes/meanf.h new file mode 100644 index 00000000..c0d687c6 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/statisticsFunctions/includes/prod.h b/2.3-1/src/c/statisticsFunctions/includes/prod.h new file mode 100644 index 00000000..a5fde84c --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/statisticsFunctions/includes/statMax.h b/2.3-1/src/c/statisticsFunctions/includes/statMax.h new file mode 100644 index 00000000..8e5d12b9 --- /dev/null +++ b/2.3-1/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 +#include +#include + + +#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/2.3-1/src/c/statisticsFunctions/includes/sum.h b/2.3-1/src/c/statisticsFunctions/includes/sum.h new file mode 100644 index 00000000..2910792e --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/statisticsFunctions/includes/variance.h b/2.3-1/src/c/statisticsFunctions/includes/variance.h new file mode 100644 index 00000000..a058bb75 --- /dev/null +++ b/2.3-1/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 +#include +#include + + +#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/2.3-1/src/c/statisticsFunctions/includes/variancef.h b/2.3-1/src/c/statisticsFunctions/includes/variancef.h new file mode 100644 index 00000000..e682a187 --- /dev/null +++ b/2.3-1/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 +#include +#include + + +#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__ */ -- cgit