The C++ interface for standard deviation. More...

array stdev (const array &in, int dim=-1)
 Standard deviation along a dimension. More...
 
template<typename ty >
ty stdev (const array &input)
 Standard deviation of all elements in a vector. More...
 

Detailed Description

The C++ interface for standard deviation.

Returns the standard deviation of a set of elements

Function Documentation

array af::stdev ( const array &  in,
int  dim = -1 
)

Standard deviation along a dimension.

Parameters
[in]inThe input matrix
[in]dimdimension along which to operate (-1 indicates first non-singleton dimension)
Returns
The standard deviation of values along the dimension dim in the input
Examples:
examples/pde/fdtd.cpp.
ty af::stdev ( const array &  input)

Standard deviation of all elements in a vector.

array a = array(seq(5));
print(a); // 0 1 2 3 4
float m = stdev<float>(a);
printf("%f\n",m); // 1.581
Parameters
[in]input
Returns
The standard deviation of all values in the input