GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
c_maxx.c
Go to the documentation of this file.
1
#include <grass/gis.h>
2
3
void
c_maxx
(DCELL * result, DCELL * values,
int
n,
const
void
*closure)
4
{
5
DCELL
max
, maxx;
6
int
i;
7
8
G_set_d_null_value
(&max, 1);
9
G_set_d_null_value
(&maxx, 1);
10
11
for
(i = 0; i < n; i++) {
12
if
(
G_is_d_null_value
(&values[i]))
13
continue
;
14
15
if
(
G_is_d_null_value
(&max) || max < values[i]) {
16
max = values[i];
17
maxx = i;
18
}
19
}
20
21
if
(
G_is_d_null_value
(&maxx))
22
G_set_d_null_value
(result, 1);
23
else
24
*result = maxx;
25
}
lib
stats
c_maxx.c
Generated on Sun Mar 16 2014 05:07:42 for GRASS Programmer's Manual by
1.8.1.2