GRASS 8 Programmer's Manual
8.6.0dev(2026)-5a31d549cc
Loading...
Searching...
No Matches
c_min.c
Go to the documentation of this file.
1
#include <
grass/gis.h
>
2
#include <
grass/raster.h
>
3
4
void
c_min
(
DCELL
*result,
DCELL
*values,
int
n,
const
void
*closure
G_UNUSED
)
5
{
6
DCELL
min
;
7
int
i;
8
9
Rast_set_d_null_value
(&
min
, 1);
10
11
for
(i = 0; i < n; i++) {
12
if
(
Rast_is_d_null_value
(&values[i]))
13
continue
;
14
15
if
(
Rast_is_d_null_value
(&
min
) ||
min
> values[i])
16
min
= values[i];
17
}
18
19
if
(
Rast_is_d_null_value
(&
min
))
20
Rast_set_d_null_value
(result, 1);
21
else
22
*result =
min
;
23
}
24
25
void
w_min
(
DCELL
*result,
DCELL
(*values)[2],
int
n,
26
const
void
*closure
G_UNUSED
)
27
{
28
DCELL
min
;
29
int
i;
30
31
Rast_set_d_null_value
(&
min
, 1);
32
33
for
(i = 0; i < n; i++) {
34
if
(
Rast_is_d_null_value
(&values[i][0]))
35
continue
;
36
37
if
(
Rast_is_d_null_value
(&
min
) ||
min
> values[i][0])
38
min
= values[i][0];
39
}
40
41
if
(
Rast_is_d_null_value
(&
min
))
42
Rast_set_d_null_value
(result, 1);
43
else
44
*result =
min
;
45
}
Rast_set_d_null_value
void Rast_set_d_null_value(DCELL *, int)
To set a number of DCELL raster values to NULL.
Definition
null_val.c:153
Rast_is_d_null_value
#define Rast_is_d_null_value(dcellVal)
Definition
defs/raster.h:417
w_min
stat_func_w w_min
c_min
stat_func c_min
min
#define min(x, y)
Definition
draw2.c:29
gis.h
G_UNUSED
#define G_UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
Definition
gis.h:46
DCELL
double DCELL
Definition
gis.h:635
raster.h
lib
stats
c_min.c
Generated on Fri Apr 17 2026 07:00:46 for GRASS 8 Programmer's Manual by
1.9.8