GRASS GIS 8 Programmer's Manual
8.4.1(2025)-45ca3179ab
Loading...
Searching...
No Matches
geary.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <math.h>
3
4
double
*
Cdhc_geary_test
(
double
*
x
,
int
n)
5
{
6
int
i;
7
static
double
y[2];
8
double
diff, s = 0.0, mean = 0.0;
9
10
y[0] = 0.0;
11
for
(i = 0; i < n; ++i)
12
mean +=
x
[i];
13
14
mean /= n;
15
16
for
(i = 0; i < n; ++i) {
17
diff =
x
[i] - mean;
18
y[0] += fabs(diff);
19
s += diff * diff;
20
}
21
22
s *= n;
23
y[0] /= sqrt(s);
24
y[1] = (y[0] - 0.7979) * sqrt((
double
)n) / 0.2123;
25
26
#ifdef NOISY
27
fprintf(stdout,
" TEST2 GTN =%10.4f Z(GTN) =%10.4f\n"
, y[0], y[1]);
28
#endif
/* NOISY */
29
30
return
y;
31
}
Cdhc_geary_test
double * Cdhc_geary_test(double *x, int n)
Definition
geary.c:4
x
#define x
cdhc
geary.c
Generated on Sat Jun 21 2025 21:07:27 for GRASS GIS 8 Programmer's Manual by
1.13.2