Create an array from a scalar input value. More...
Functions | |
template<typename T > | |
array | constant (T val, const dim4 &dims, const dtype ty=(af_dtype) dtype_traits< T >::ctype) |
C++ Interface to generate an array with elements set to a specified value. More... | |
template<typename T > | |
array | constant (T val, const dim_t d0, const af_dtype ty=(af_dtype) dtype_traits< T >::ctype) |
C++ Interface to generate a 1-D array with elements set to a specified value. More... | |
template<typename T > | |
array | constant (T val, const dim_t d0, const dim_t d1, const af_dtype ty=(af_dtype) dtype_traits< T >::ctype) |
C++ Interface to generate a 2-D array with elements set to a specified value. More... | |
template<typename T > | |
array | constant (T val, const dim_t d0, const dim_t d1, const dim_t d2, const af_dtype ty=(af_dtype) dtype_traits< T >::ctype) |
C++ Interface to generate a 3-D array with elements set to a specified value. More... | |
template<typename T > | |
array | constant (T val, const dim_t d0, const dim_t d1, const dim_t d2, const dim_t d3, const af_dtype ty=(af_dtype) dtype_traits< T >::ctype) |
C++ Interface to generate a 4-D array with elements set to a specified value. More... | |
AFAPI af_err | af_constant (af_array *arr, const double val, const unsigned ndims, const dim_t *const dims, const af_dtype type) |
C Interface to generate an array with elements set to a specified value. More... | |
AFAPI af_err | af_constant_complex (af_array *arr, const double real, const double imag, const unsigned ndims, const dim_t *const dims, const af_dtype type) |
C Interface to generate a complex array with elements set to a specified value. More... | |
AFAPI af_err | af_constant_long (af_array *arr, const long long val, const unsigned ndims, const dim_t *const dims) |
C Interface to generate an array with elements set to a specified value. More... | |
AFAPI af_err | af_constant_ulong (af_array *arr, const unsigned long long val, const unsigned ndims, const dim_t *const dims) |
C Interface to generate an array with elements set to a specified value. More... | |
Create an array from a scalar input value.
Generate an array with elements set to a specified value.
AFAPI af_err af_constant | ( | af_array * | arr, |
const double | val, | ||
const unsigned | ndims, | ||
const dim_t *const | dims, | ||
const af_dtype | type | ||
) |
C Interface to generate an array with elements set to a specified value.
[out] | arr | constant array |
[in] | val | constant value |
[in] | ndims | size of the dimension array |
[in] | dims | dimensions of the array to be generated |
[in] | type | type |
AFAPI af_err af_constant_complex | ( | af_array * | arr, |
const double | real, | ||
const double | imag, | ||
const unsigned | ndims, | ||
const dim_t *const | dims, | ||
const af_dtype | type | ||
) |
C Interface to generate a complex array with elements set to a specified value.
[out] | arr | constant complex array |
[in] | real | real constant value |
[in] | imag | imaginary constant value |
[in] | ndims | size of the dimension array |
[in] | dims | dimensions of the array to be generated |
[in] | type | type, c32 or c64 |
AFAPI af_err af_constant_long | ( | af_array * | arr, |
const long long | val, | ||
const unsigned | ndims, | ||
const dim_t *const | dims | ||
) |
C Interface to generate an array with elements set to a specified value.
Output type is s64.
[out] | arr | constant array |
[in] | val | constant value |
[in] | ndims | size of the dimension array |
[in] | dims | dimensions of the array to be generated |
AFAPI af_err af_constant_ulong | ( | af_array * | arr, |
const unsigned long long | val, | ||
const unsigned | ndims, | ||
const dim_t *const | dims | ||
) |
C Interface to generate an array with elements set to a specified value.
Output type is u64.
[out] | arr | constant array |
[in] | val | constant value |
[in] | ndims | size of the dimension array |
[in] | dims | dimensions of the array to be generated |
array constant | ( | T | val, |
const dim4 & | dims, | ||
const dtype | ty = (af_dtype) dtype_traits< T >::ctype |
||
) |
C++ Interface to generate an array with elements set to a specified value.
[in] | val | constant value |
[in] | dims | dimensions of the array to be generated |
[in] | ty | type |
array constant | ( | T | val, |
const dim_t | d0, | ||
const af_dtype | ty = (af_dtype) dtype_traits< T >::ctype |
||
) |
C++ Interface to generate a 1-D array with elements set to a specified value.
[in] | val | constant value |
[in] | d0 | size of the first dimension |
[in] | ty | type |
array constant | ( | T | val, |
const dim_t | d0, | ||
const dim_t | d1, | ||
const af_dtype | ty = (af_dtype) dtype_traits< T >::ctype |
||
) |
C++ Interface to generate a 2-D array with elements set to a specified value.
[in] | val | constant value |
[in] | d0 | size of the first dimension |
[in] | d1 | size of the second dimension |
[in] | ty | type |
array constant | ( | T | val, |
const dim_t | d0, | ||
const dim_t | d1, | ||
const dim_t | d2, | ||
const af_dtype | ty = (af_dtype) dtype_traits< T >::ctype |
||
) |
C++ Interface to generate a 3-D array with elements set to a specified value.
[in] | val | constant value |
[in] | d0 | size of the first dimension |
[in] | d1 | size of the second dimension |
[in] | d2 | size of the third dimension |
[in] | ty | type |
array constant | ( | T | val, |
const dim_t | d0, | ||
const dim_t | d1, | ||
const dim_t | d2, | ||
const dim_t | d3, | ||
const af_dtype | ty = (af_dtype) dtype_traits< T >::ctype |
||
) |
C++ Interface to generate a 4-D array with elements set to a specified value.
[in] | val | constant value |
[in] | d0 | size of the first dimension |
[in] | d1 | size of the second dimension |
[in] | d2 | size of the third dimension |
[in] | d3 | size of the fourth dimension |
[in] | ty | type |