GRASS GIS 7 Programmer's Manual
7.9.dev(2021)-e5379bbd7
Main Page
Related Pages
+
Data Structures
Data Structures
Class Hierarchy
+
Data Fields
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
x
y
+
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
r
s
t
u
v
w
y
z
+
Enumerations
a
c
d
e
h
l
m
n
o
p
r
s
t
v
y
+
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
var.c
Go to the documentation of this file.
1
#include <math.h>
2
#include <
grass/imagery.h
>
3
/* sum: sum of x
4
* sum2: sum of x squared
5
* n: number of points
6
*/
7
8
double
I_variance
(
double
sum,
double
sum2,
int
n)
9
{
10
if
(n < 2)
11
return
((
double
)0.0);
12
else
13
return
((sum2 - sum * sum / n) / (n - 1));
14
}
15
16
double
I_stddev
(
double
sum,
double
sum2,
int
n)
17
{
18
if
(n < 2)
19
return
((
double
)-99.0);
20
else
21
return
sqrt(
I_variance
(sum, sum2, n));
22
}
I_stddev
double I_stddev(double sum, double sum2, int n)
Definition:
var.c:16
imagery.h
I_variance
double I_variance(double sum, double sum2, int n)
Definition:
var.c:8
lib
imagery
var.c
Generated on Mon May 31 2021 05:21:32 for GRASS GIS 7 Programmer's Manual by
1.8.13