GRASS Programmer's Manual
6.5.svn(2014)-r66266
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
geary.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <math.h>
3
4
5
double
*
geary_test
(
double
*x,
int
n
)
6
{
7
int
i;
8
static
double
y
[2];
9
double
diff,
s
= 0.0, mean = 0.0;
10
11
y[0] = 0.0;
12
for
(i = 0; i <
n
; ++i)
13
mean += x[i];
14
15
mean /=
n
;
16
17
for
(i = 0; i <
n
; ++i) {
18
diff = x[i] - mean;
19
y[0] += fabs(diff);
20
s += diff * diff;
21
}
22
23
s *=
n
;
24
y[0] /= sqrt(s);
25
y[1] = (y[0] - 0.7979) * sqrt((
double
)n) / 0.2123;
26
27
#ifdef NOISY
28
fprintf(stdout,
" TEST2 GTN =%10.4f Z(GTN) =%10.4f\n"
, y[0], y[1]);
29
#endif
/* NOISY */
30
31
return
y
;
32
}
dialogs.s
tuple s
Definition:
psmap/dialogs.py:2766
y
int y
Definition:
plot.c:34
geary_test
double * geary_test(double *x, int n)
Definition:
geary.c:5
n
int n
Definition:
dataquad.c:291
lib
cdhc
geary.c
Generated on Sat Jan 2 2016 01:46:47 for GRASS Programmer's Manual by
1.8.5