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_minx.c
Go to the documentation of this file.
1
#include <grass/gis.h>
2
3
4
void
c_minx
(DCELL * result, DCELL * values,
int
n,
const
void
*closure)
5
{
6
DCELL
min
, minx;
7
int
i;
8
9
G_set_d_null_value
(&min, 1);
10
G_set_d_null_value
(&minx, 1);
11
12
for
(i = 0; i < n; i++) {
13
if
(
G_is_d_null_value
(&values[i]))
14
continue
;
15
16
if
(
G_is_d_null_value
(&min) || min > values[i]) {
17
min = values[i];
18
minx = i;
19
}
20
}
21
22
if
(
G_is_d_null_value
(&minx))
23
G_set_d_null_value
(result, 1);
24
else
25
*result = minx;
26
}
lib
stats
c_minx.c
Generated on Sun Mar 16 2014 05:07:42 for GRASS Programmer's Manual by
1.8.1.2