GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-9f2952cf23
c_stddev.c
Go to the documentation of this file.
1 #include <math.h>
2 
3 #include <grass/gis.h>
4 #include <grass/raster.h>
5 #include <grass/stats.h>
6 
7 void c_stddev(DCELL *result, DCELL *values, int n, const void *closure)
8 {
9  DCELL var;
10 
11  c_var(&var, values, n, closure);
12 
14  Rast_set_d_null_value(result, 1);
15  else
16  *result = sqrt(var);
17 }
18 
19 void w_stddev(DCELL *result, DCELL (*values)[2], int n, const void *closure)
20 {
21  DCELL var;
22 
23  w_var(&var, values, n, closure);
24 
26  Rast_set_d_null_value(result, 1);
27  else
28  *result = sqrt(var);
29 }
void w_stddev(DCELL *result, DCELL(*values)[2], int n, const void *closure)
Definition: c_stddev.c:19
void c_stddev(DCELL *result, DCELL *values, int n, const void *closure)
Definition: c_stddev.c:7
void Rast_set_d_null_value(DCELL *, int)
To set a number of DCELL raster values to NULL.
Definition: null_val.c:153
#define Rast_is_d_null_value(dcellVal)
Definition: defs/raster.h:405
stat_func_w w_var
stat_func c_var
double DCELL
Definition: gis.h:628
float var(IClass_statistics *statistics, int band1, int band2)
Helper function for computing variance.