Find the variance of values in the input. More...

Functions

AFAPI array var (const array &in, const bool isbiased=false, const dim_t dim=-1)
 C++ Interface for variance. More...
 
AFAPI array var (const array &in, const array &weights, const dim_t dim=-1)
 C++ Interface for variance of weighted inputs. More...
 
template<typename T >
AFAPIvar (const array &in, const bool isbiased=false)
 C++ Interface for variance of all elements. More...
 
template<typename T >
AFAPIvar (const array &in, const array &weights)
 C++ Interface for variance of all elements in weighted input. More...
 
AFAPI af_err af_var (af_array *out, const af_array in, const bool isbiased, const dim_t dim)
 C Interface for variance. More...
 
AFAPI af_err af_var_weighted (af_array *out, const af_array in, const af_array weights, const dim_t dim)
 C Interface for variance of weighted input array. More...
 
AFAPI af_err af_var_all (double *realVal, double *imagVal, const af_array in, const bool isbiased)
 C Interface for variance of all elements. More...
 
AFAPI af_err af_var_all_weighted (double *realVal, double *imagVal, const af_array in, const af_array weights)
 C Interface for variance of all elements in weighted input. More...
 

Detailed Description

Find the variance of values in the input.

This function performs the operation across all batches present in the input simultaneously.


Function Documentation

AFAPI af_err af_var ( af_array out,
const af_array  in,
const bool  isbiased,
const dim_t  dim 
)

C Interface for variance.

Parameters
[out]outwill contain the variance of the input array along dimension dim
[in]inis the input array
[in]isbiasedis boolean denoting Population variance (false) or Sample Variance (true)
[in]dimthe dimension along which the variance is extracted
Returns
AF_SUCCESS if the operation is successful, otherwise an appropriate error code is returned.
AFAPI af_err af_var_all ( double *  realVal,
double *  imagVal,
const af_array  in,
const bool  isbiased 
)

C Interface for variance of all elements.

Parameters
[out]realValwill contain the real part of variance of the entire input array
[out]imagValwill contain the imaginary part of variance of the entire input array
[in]inis the input array
[in]isbiasedis boolean denoting Population variance (false) or Sample Variance (true)
Returns
AF_SUCCESS if the operation is successful, otherwise an appropriate error code is returned.
AFAPI af_err af_var_all_weighted ( double *  realVal,
double *  imagVal,
const af_array  in,
const af_array  weights 
)

C Interface for variance of all elements in weighted input.

Parameters
[out]realValwill contain the real part of variance of the entire weighted input array
[out]imagValwill contain the imaginary part of variance of the entire weighted input array
[in]inis the input array
[in]weightsis used to scale input in before getting variance
Returns
AF_SUCCESS if the operation is successful, otherwise an appropriate error code is returned.
AFAPI af_err af_var_weighted ( af_array out,
const af_array  in,
const af_array  weights,
const dim_t  dim 
)

C Interface for variance of weighted input array.

Parameters
[out]outwill contain the variance of the input array along dimension dim
[in]inis the input array
[in]weightsis used to scale input in before getting variance
[in]dimthe dimension along which the variance is extracted
Returns
AF_SUCCESS if the operation is successful, otherwise an appropriate error code is returned.
AFAPI array af::var ( const array in,
const bool  isbiased = false,
const dim_t  dim = -1 
)

C++ Interface for variance.

Parameters
[in]inis the input array
[in]isbiasedis boolean denoting Population variance (false) or Sample Variance (true)
[in]dimthe dimension along which the variance is extracted
Returns
the variance of the input array along dimension dim
Note
dim is -1 by default. -1 denotes the first non-singleton dimension.
Examples:
machine_learning/naive_bayes.cpp.
AFAPI array af::var ( const array in,
const array weights,
const dim_t  dim = -1 
)

C++ Interface for variance of weighted inputs.

Parameters
[in]inis the input array
[in]weightsis used to scale input in before getting variance
[in]dimthe dimension along which the variance is extracted
Returns
the variance of the weighted input array along dimension dim
Note
dim is -1 by default. -1 denotes the first non-singleton dimension.
AFAPI T af::var ( const array in,
const bool  isbiased = false 
)

C++ Interface for variance of all elements.

Parameters
[in]inis the input array
[in]isbiasedis boolean denoting Population variance (false) or Sample Variance (true)
Returns
variance of the entire input array
AFAPI T af::var ( const array in,
const array weights 
)

C++ Interface for variance of all elements in weighted input.

Parameters
[in]inis the input array
[in]weightsis used to scale input in before getting variance
Returns
variance of the entire input array