summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/statisticsFunctions/includes/stdevf.h
blob: c9e4859969fe44609926fcae09b323b94eb6b57d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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__ */