GRASS GIS 8 Programmer's Manual
8.3.2(2024)-exported
Loading...
Searching...
No Matches
extreme.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <math.h>
3
4
double
*
Cdhc_extreme
(
double
*x,
int
n)
5
{
6
int
i;
7
static
double
y[2];
8
double
min
,
max
, sum1 = 0.;
9
10
min
=
max
=
x
[0];
11
for
(i = 0; i < n; ++i) {
12
sum1 +=
x
[i];
13
if
(
min
>
x
[i])
14
min
=
x
[i];
15
16
if
(
max
<
x
[i])
17
max
=
x
[i];
18
}
19
sum1 /= n;
20
21
y[0] =
max
- sum1;
22
y[1] =
min
- sum1;
23
24
#ifdef NOISY
25
fprintf(stdout,
" TEST3 U(N) =%10.4f U(1) =%10.4f\n"
, y[0], y[1]);
26
#endif
/* NOISY */
27
28
return
y;
29
}
Cdhc_extreme
double * Cdhc_extreme(double *x, int n)
Definition
extreme.c:4
min
#define min(a, b)
Definition
pngdriver/draw_bitmap.c:19
max
#define max(a, b)
Definition
pngdriver/draw_bitmap.c:22
x
#define x
cdhc
extreme.c
Generated on Sat Nov 9 2024 17:44:25 for GRASS GIS 8 Programmer's Manual by
1.12.0