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

Functions

AFAPI array product (const array &in, const int dim=-1)
 C++ Interface for product of elements in an array. More...
 
template<typename T >
product (const array &in)
 C++ Interface for product of all elements in an array. More...
 
AFAPI af_err af_product (af_array *out, const af_array in, const int dim)
 C Interface for product of elements in an array. More...
 
AFAPI af_err af_product_all (double *real, double *imag, const af_array in)
 C Interface for product of all elements in an array. More...
 
AFAPI array mul (const array &in, const int dim=-1)
 C++ Interface for product of elements in an array. More...
 
template<typename T >
mul (const array &in)
 C++ Interface for product of all elements in an array. More...
 

Detailed Description

Find the product of values in the input.

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

Function Documentation

AFAPI af_err af_product ( af_array out,
const af_array  in,
const int  dim 
)

C Interface for product of elements in an array.

Parameters
[out]outwill contain the product of all values in in along dim
[in]inis the input array
[in]dimThe dimension along which the multiply operation occurs
Returns
AF_SUCCESS if the execution completes properly
AFAPI af_err af_product_all ( double *  real,
double *  imag,
const af_array  in 
)

C Interface for product of all elements in an array.

Parameters
[out]realwill contain the real part of multiplying all elements in input in
[out]imagwill contain the imaginary part of multiplying all elements in input in
[in]inis the input array
Returns
AF_SUCCESS if the execution completes properly
Note
imag is always set to 0 when in is real
AFAPI array af::mul ( const array in,
const int  dim = -1 
)

C++ Interface for product of elements in an array.

Parameters
[in]inis the input array
[in]dimThe dimension along which the multiply operation occurs
Returns
result of product all values along dimension dim
Note
dim is -1 by default. -1 denotes the first non-singleton dimension.
Deprecated:
Use product instead
T af::mul ( const array in)

C++ Interface for product of all elements in an array.

Parameters
[in]inis the input array
Returns
the product of all values of in
Deprecated:
Use product instead
AFAPI array af::product ( const array in,
const int  dim = -1 
)

C++ Interface for product of elements in an array.

Parameters
[in]inis the input array
[in]dimThe dimension along which the multiply operation occurs
Returns
result of product all values along dimension dim
Note
dim is -1 by default. -1 denotes the first non-singleton dimension.
Examples:
integer.cpp, and monte_carlo_options.cpp.
T af::product ( const array in)

C++ Interface for product of all elements in an array.

Parameters
[in]inis the input array
Returns
the product of all values of in