GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
c_count.c
Go to the documentation of this file.
1 #include <grass/gis.h>
2 
3 void c_count(DCELL * result, DCELL * values, int n, const void *closure)
4 {
5  int count;
6  int i;
7 
8  count = 0;
9 
10  for (i = 0; i < n; i++)
11  if (!G_is_d_null_value(&values[i]))
12  count++;
13 
14  *result = count;
15 }
16 
17 void w_count(DCELL * result, DCELL(*values)[2], int n, const void *closure)
18 {
19  DCELL count;
20  int i;
21 
22  count = 0.0;
23 
24  for (i = 0; i < n; i++)
25  if (!G_is_d_null_value(&values[i][0]))
26  count += values[i][1];
27 
28  *result = count;
29 }
int count
void w_count(DCELL *result, DCELL(*values)[2], int n, const void *closure)
Definition: c_count.c:17
int G_is_d_null_value(const DCELL *dcellVal)
Returns 1 if dcell is NULL, 0 otherwise. This will test if the value dcell is a NaN. Same test as in G_is_f_null_value().
Definition: null_val.c:306
void c_count(DCELL *result, DCELL *values, int n, const void *closure)
Definition: c_count.c:3
int n
Definition: dataquad.c:291