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
extreme.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <math.h>
3
4
5
double
*
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:68
y
int y
Definition:
plot.c:34
max
#define max(x, y)
Definition:
draw2.c:69
extreme
double * extreme(double *x, int n)
Definition:
extreme.c:5
n
int n
Definition:
dataquad.c:291
lib
cdhc
extreme.c
Generated on Sat Jan 2 2016 01:46:47 for GRASS Programmer's Manual by
1.8.5