A high-performance general-purpose compute library

Functions

AFAPI array var (const array &in, const bool isbiased=false, const dim_t dim=-1)
 C++ Interface for variance.
 
AFAPI array var (const array &in, const af_var_bias bias, const dim_t dim=-1)
 C++ Interface for variance.
 
AFAPI array var (const array &in, const array &weights, const dim_t dim=-1)
 C++ Interface for variance of weighted inputs.
 
template<typename T >
AFAPIvar (const array &in, const bool isbiased=false)
 C++ Interface for variance of all elements.
 
template<typename T >
AFAPIvar (const array &in, const af_var_bias bias)
 C++ Interface for variance of all elements.
 
template<typename T >
AFAPIvar (const array &in, const array &weights)
 C++ Interface for variance of all elements in weighted input.
 
AFAPI af_err af_var (af_array *out, const af_array in, const bool isbiased, const dim_t dim)
 C Interface for variance.
 
AFAPI af_err af_var_v2 (af_array *out, const af_array in, const af_var_bias bias, const dim_t dim)
 C Interface for variance.
 
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.
 
AFAPI af_err af_var_all (double *realVal, double *imagVal, const af_array in, const bool isbiased)
 C Interface for variance of all elements.
 
AFAPI af_err af_var_all_v2 (double *realVal, double *imagVal, const af_array in, const af_var_bias bias)
 C Interface for variance of all elements.
 
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.
 

Detailed Description

Find the variance of values in the input

This function performs the operation across all dimensions of the input array.


Function Documentation

◆ af_var()

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.
Deprecated
Use af_var_v2 instead

◆ af_var_all()

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.
Deprecated
Use af_var_all_v2 instead

◆ af_var_all_v2()

AFAPI af_err af_var_all_v2 ( double * realVal,
double * imagVal,
const af_array in,
const af_var_bias bias )

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]biasThe type of bias used for variance calculation. Takes of value of type af_var_bias
Returns
AF_SUCCESS if the operation is successful, otherwise an appropriate error code is returned.

◆ af_var_all_weighted()

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.

◆ af_var_v2()

AFAPI af_err af_var_v2 ( af_array * out,
const af_array in,
const af_var_bias bias,
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]biasThe type of bias used for variance calculation. Takes of value of type af_var_bias
[in]dimthe dimension along which the variance is extracted
Returns
AF_SUCCESS if the operation is successful, otherwise an appropriate error code is returned.

◆ af_var_weighted()

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.

◆ var() [1/6]

template<typename T >
AFAPI T var ( const array & in,
const af_var_bias bias )

C++ Interface for variance of all elements.

Parameters
[in]inis the input array
[in]biasThe type of bias used for variance calculation. Takes of value of type af_var_bias.
Returns
variance of the in array

◆ var() [2/6]

AFAPI array var ( const array & in,
const af_var_bias bias,
const dim_t dim = -1 )

C++ Interface for variance.

Parameters
[in]inis the input array
[in]biasThe type of bias used for variance calculation. Takes o value of type af_var_bias.
[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.

◆ var() [3/6]

template<typename T >
AFAPI T 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

◆ var() [4/6]

AFAPI array 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.

◆ var() [5/6]

template<typename T >
AFAPI T 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
Deprecated
Use af::var that takes af_var_bias instead

◆ var() [6/6]

AFAPI array 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.
Deprecated
Use af::var that takes af_var_bias instead