GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
extreme.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <math.h>
3
4
5
double
*
Cdhc_extreme
(
double
*
x
,
int
n)
6
{
7
int
i;
8
static
double
y[2];
9
double
min
,
max
, sum1 = 0.;
10
11
min = max = x[0];
12
for
(i = 0; i < n; ++i) {
13
sum1 += x[i];
14
if
(min > x[i])
15
min = x[i];
16
17
if
(max < x[i])
18
max = x[i];
19
}
20
sum1 /= n;
21
22
y[0] = max - sum1;
23
y[1] = min - sum1;
24
25
#ifdef NOISY
26
fprintf(stdout,
" TEST3 U(N) =%10.4f U(1) =%10.4f\n"
, y[0], y[1]);
27
#endif
/* NOISY */
28
29
return
y;
30
}
min
#define min(x, y)
Definition:
draw2.c:31
x
#define x
max
#define max(x, y)
Definition:
draw2.c:32
Cdhc_extreme
double * Cdhc_extreme(double *x, int n)
Definition:
extreme.c:5
lib
cdhc
extreme.c
Generated on Tue Feb 14 2023 05:55:59 for GRASS GIS 8 Programmer's Manual by
1.8.13