af Namespace Reference

Data Structures

struct  af_cdouble
 
struct  af_cfloat
 
class  array
 A multi dimensional data container. More...
 
class  dim4
 Generic object that represents size and shape. More...
 
struct  dtype_traits
 
struct  dtype_traits< af::cdouble >
 
struct  dtype_traits< af::cfloat >
 
struct  dtype_traits< char >
 
struct  dtype_traits< double >
 
struct  dtype_traits< float >
 
struct  dtype_traits< half >
 
struct  dtype_traits< int >
 
struct  dtype_traits< long long >
 
struct  dtype_traits< short >
 
struct  dtype_traits< std::complex< double > >
 
struct  dtype_traits< std::complex< float > >
 
struct  dtype_traits< unsigned >
 
struct  dtype_traits< unsigned char >
 
struct  dtype_traits< unsigned long long >
 
struct  dtype_traits< unsigned short >
 
class  event
 C++ RAII interface for manipulating events. More...
 
class  exception
 An ArrayFire exception class. More...
 
class  features
 Represents a feature returned by a feature detector. More...
 
class  index
 Wrapper for af_index. More...
 
class  randomEngine
 Random Number Generation Engine Class. More...
 
class  seq
 seq is used to create sequences for indexing af::array More...
 
struct  timer
 Internal timer object. More...
 
class  Window
 Window object to render af::arrays. More...
 

Typedefs

typedef struct af::af_cfloat af_cfloat
 
typedef struct af::af_cdouble af_cdouble
 
typedef af::af_cfloat cfloat
 
typedef af::af_cdouble cdouble
 
typedef af_dtype dtype
 
typedef af_source source
 
typedef af_interp_type interpType
 
typedef af_border_type borderType
 
typedef af_connectivity connectivity
 
typedef af_match_type matchType
 
typedef af_cspace_t CSpace
 
typedef af_someenum_t SomeEnum
 
typedef af_mat_prop trans
 
typedef af_conv_mode convMode
 
typedef af_conv_domain convDomain
 
typedef af_mat_prop matProp
 
typedef af_colormap ColorMap
 
typedef af_norm_type normType
 
typedef af_ycc_std YCCStd
 
typedef af_image_format imageFormat
 
typedef af_backend Backend
 
typedef af_marker_type markerType
 
typedef af_moment_type momentType
 
typedef af_storage storage
 
typedef af_binary_op binaryOp
 
typedef af_random_engine_type randomEngineType
 
typedef af_canny_threshold cannyThreshold
 
typedef af_flux_function fluxFunction
 
typedef af_diffusion_eq diffusionEq
 
typedef af_topk_function topkFunction
 
typedef af_var_bias varBias
 
typedef af_iterative_deconv_algo iterativeDeconvAlgo
 
typedef af_inverse_deconv_algo inverseDeconvAlgo
 
typedef af_conv_gradient_type convGradientType
 
typedef array(* batchFunc_t) (const array &lhs, const array &rhs)
 
typedef af_half half
 
typedef struct af::timer timer
 Internal timer object. More...
 

Functions

AFAPI array sum (const array &in, const int dim=-1)
 C++ Interface for sum of elements in an array. More...
 
AFAPI array sum (const array &in, const int dim, const double nanval)
 C++ Interface for sum of elements in an array while replacing nan values. More...
 
AFAPI void sumByKey (array &keys_out, array &vals_out, const array &keys, const array &vals, const int dim=-1)
 C++ Interface for sum of elements along given dimension by key. More...
 
AFAPI void sumByKey (array &keys_out, array &vals_out, const array &keys, const array &vals, const int dim, const double nanval)
 C++ Interface for sum of elements along given dimension by key while replacing nan values. More...
 
AFAPI array product (const array &in, const int dim=-1)
 C++ Interface for product of elements in an array. More...
 
AFAPI array product (const array &in, const int dim, const double nanval)
 C++ Interface for product of elements in an array while replacing nan values. More...
 
AFAPI void productByKey (array &keys_out, array &vals_out, const array &keys, const array &vals, const int dim=-1)
 C++ Interface for product of elements in an array according to a key. More...
 
AFAPI void productByKey (array &keys_out, array &vals_out, const array &keys, const array &vals, const int dim, const double nanval)
 C++ Interface for product of elements in an array according to a key while replacing nan values. More...
 
AFAPI array min (const array &in, const int dim=-1)
 C++ Interface for minimum values in an array. More...
 
AFAPI void minByKey (array &keys_out, array &vals_out, const array &keys, const array &vals, const int dim=-1)
 C++ Interface for minimum values in an array according to a key. More...
 
AFAPI array max (const array &in, const int dim=-1)
 C++ Interface for maximum values in an array. More...
 
AFAPI void maxByKey (array &keys_out, array &vals_out, const array &keys, const array &vals, const int dim=-1)
 C++ Interface for maximum values in an array according to a key. More...
 
AFAPI array allTrue (const array &in, const int dim=-1)
 C++ Interface for checking all true values in an array. More...
 
AFAPI void allTrueByKey (array &keys_out, array &vals_out, const array &keys, const array &vals, const int dim=-1)
 C++ Interface for checking all true values in an array according to a key. More...
 
AFAPI array anyTrue (const array &in, const int dim=-1)
 C++ Interface for checking any true values in an array. More...
 
AFAPI void anyTrueByKey (array &keys_out, array &vals_out, const array &keys, const array &vals, const int dim=-1)
 C++ Interface for checking any true values in an array according to a key. More...
 
AFAPI array count (const array &in, const int dim=-1)
 C++ Interface for counting non-zero values in an array. More...
 
AFAPI void countByKey (array &keys_out, array &vals_out, const array &keys, const array &vals, const int dim=-1)
 C++ Interface for counting non-zero values in an array according to a key. More...
 
template<typename T >
sum (const array &in)
 C++ Interface for sum of all elements in an array. More...
 
template<typename T >
sum (const array &in, double nanval)
 C++ Interface for sum of all elements in an array while replacing nan values. More...
 
template<typename T >
product (const array &in)
 C++ Interface for product of all elements in an array. More...
 
template<typename T >
product (const array &in, double nanval)
 C++ Interface for product of all elements in an array while replacing nan values. More...
 
template<typename T >
min (const array &in)
 C++ Interface for getting minimum value of an array. More...
 
template<typename T >
max (const array &in)
 C++ Interface for getting maximum value of an array. More...
 
template<typename T >
allTrue (const array &in)
 C++ Interface for checking if all values in an array are true. More...
 
template<typename T >
anyTrue (const array &in)
 C++ Interface for checking if any values in an array are true. More...
 
template<typename T >
count (const array &in)
 C++ Interface for counting total number of non-zero values in an array. More...
 
AFAPI void min (array &val, array &idx, const array &in, const int dim=-1)
 C++ Interface for getting minimum values and their locations in an array. More...
 
AFAPI void max (array &val, array &idx, const array &in, const int dim=-1)
 C++ Interface for getting maximum values and their locations in an array. More...
 
template<typename T >
void min (T *val, unsigned *idx, const array &in)
 C++ Interface for getting minimum value and its location from the entire array. More...
 
template<typename T >
void max (T *val, unsigned *idx, const array &in)
 C++ Interface for getting maximum value and its location from the entire array. More...
 
AFAPI array accum (const array &in, const int dim=0)
 C++ Interface for computing the cumulative sum (inclusive) of an array. More...
 
AFAPI array scan (const array &in, const int dim=0, binaryOp op=AF_BINARY_ADD, bool inclusive_scan=true)
 C++ Interface generalized scan of an array. More...
 
AFAPI array scanByKey (const array &key, const array &in, const int dim=0, binaryOp op=AF_BINARY_ADD, bool inclusive_scan=true)
 C++ Interface generalized scan by key of an array. More...
 
AFAPI array where (const array &in)
 C++ Interface for finding the locations of non-zero values in an array. More...
 
AFAPI array diff1 (const array &in, const int dim=0)
 C++ Interface for calculating first order differences in an array. More...
 
AFAPI array diff2 (const array &in, const int dim=0)
 C++ Interface for calculating second order differences in an array. More...
 
AFAPI array sort (const array &in, const unsigned dim=0, const bool isAscending=true)
 C++ Interface for sorting an array. More...
 
AFAPI void sort (array &out, array &indices, const array &in, const unsigned dim=0, const bool isAscending=true)
 C++ Interface for sorting an array and getting original indices. More...
 
AFAPI void sort (array &out_keys, array &out_values, const array &keys, const array &values, const unsigned dim=0, const bool isAscending=true)
 C++ Interface for sorting an array based on keys. More...
 
AFAPI array setUnique (const array &in, const bool is_sorted=false)
 C++ Interface for getting unique values. More...
 
AFAPI array setUnion (const array &first, const array &second, const bool is_unique=false)
 C++ Interface for finding the union of two arrays. More...
 
AFAPI array setIntersect (const array &first, const array &second, const bool is_unique=false)
 C++ Interface for finding the intersection of two arrays. More...
 
AFAPI array abs (const array &in)
 C++ Interface for absolute value. More...
 
AFAPI array arg (const array &in)
 C++ Interface for arg. More...
 
AFAPI array sign (const array &in)
 C++ Interface for getting the sign of input. More...
 
AFAPI array round (const array &in)
 C++ Interface for rounding an array of numbers. More...
 
AFAPI array trunc (const array &in)
 C++ Interface for truncating an array of numbers. More...
 
AFAPI array floor (const array &in)
 C++ Interface for flooring an array of numbers. More...
 
AFAPI array ceil (const array &in)
 C++ Interface for ceiling an array of numbers. More...
 
AFAPI array sin (const array &in)
 C++ Interface for sin. More...
 
AFAPI array cos (const array &in)
 C++ Interface for cos. More...
 
AFAPI array tan (const array &in)
 C++ Interface for tan. More...
 
AFAPI array asin (const array &in)
 C++ Interface for arc sin (sin inverse) More...
 
AFAPI array acos (const array &in)
 C++ Interface for arc cos (cos inverse) More...
 
AFAPI array atan (const array &in)
 C++ Interface for arc tan (tan inverse) More...
 
AFAPI array real (const array &in)
 C++ Interface for getting real part from complex array. More...
 
AFAPI array imag (const array &in)
 C++ Interface for getting imaginary part from complex array. More...
 
AFAPI array conjg (const array &in)
 C++ Interface for getting the complex conjugate of input array. More...
 
AFAPI array sinh (const array &in)
 C++ Interface for sinh. More...
 
AFAPI array cosh (const array &in)
 C++ Interface for cosh. More...
 
AFAPI array tanh (const array &in)
 C++ Interface for tanh. More...
 
AFAPI array asinh (const array &in)
 C++ Interface for sinh inverse. More...
 
AFAPI array acosh (const array &in)
 C++ Interface for cosh inverse. More...
 
AFAPI array atanh (const array &in)
 C++ Interface for tanh inverse. More...
 
AFAPI array root (const array &lhs, const array &rhs)
 C++ Interface for nth root. More...
 
AFAPI array root (const array &lhs, const double rhs)
 C++ Interface for nth root. More...
 
AFAPI array root (const double lhs, const array &rhs)
 C++ Interface for nth root. More...
 
AFAPI array sigmoid (const array &in)
 C++ Interface for calculating sigmoid function of an array. More...
 
AFAPI array exp (const array &in)
 C++ Interface for exponential of an array. More...
 
AFAPI array expm1 (const array &in)
 C++ Interface for exponential of an array minus 1. More...
 
AFAPI array erf (const array &in)
 C++ Interface for error function value. More...
 
AFAPI array erfc (const array &in)
 C++ Interface for complementary error function value. More...
 
AFAPI array log (const array &in)
 C++ Interface for natural logarithm. More...
 
AFAPI array log1p (const array &in)
 C++ Interface for natural logarithm of 1 + input. More...
 
AFAPI array log10 (const array &in)
 C++ Interface for logarithm base 10. More...
 
AFAPI array log2 (const array &in)
 C++ Interface for logarithm base 2. More...
 
AFAPI array sqrt (const array &in)
 C++ Interface for square root of input. More...
 
AFAPI array rsqrt (const array &in)
 C++ Interface for reciprocal square root of input. More...
 
AFAPI array cbrt (const array &in)
 C++ Interface for cube root of input. More...
 
AFAPI array factorial (const array &in)
 C++ Interface for factorial of input. More...
 
AFAPI array tgamma (const array &in)
 C++ Interface for gamma function of input. More...
 
AFAPI array lgamma (const array &in)
 C++ Interface for logarithm of absolute value of gamma function of input. More...
 
AFAPI array iszero (const array &in)
 C++ Interface for checking if values are zero. More...
 
AFAPI array isInf (const array &in)
 C++ Interface for checking if values are Infinities. More...
 
AFAPI array isNaN (const array &in)
 C++ Interface for checking if values are NaNs. More...
 
AFAPI void setBackend (const Backend bknd)
 
AFAPI unsigned getBackendCount ()
 
AFAPI int getAvailableBackends ()
 Returns a flag of all available backends. More...
 
AFAPI af::Backend getBackendId (const array &in)
 
AFAPI af::Backend getActiveBackend ()
 
AFAPI int getDeviceId (const array &in)
 
AFAPI array matmul (const array &lhs, const array &rhs, const matProp optLhs=AF_MAT_NONE, const matProp optRhs=AF_MAT_NONE)
 Matrix multiply of two arrays. More...
 
AFAPI array matmulNT (const array &lhs, const array &rhs)
 Matrix multiply of two arrays. More...
 
AFAPI array matmulTN (const array &lhs, const array &rhs)
 Matrix multiply of two arrays. More...
 
AFAPI array matmulTT (const array &lhs, const array &rhs)
 Matrix multiply of two arrays. More...
 
AFAPI array matmul (const array &a, const array &b, const array &c)
 Chain 2 matrix multiplications. More...
 
AFAPI array matmul (const array &a, const array &b, const array &c, const array &d)
 Chain 3 matrix multiplications. More...
 
template<typename T >
dot (const array &lhs, const array &rhs, const matProp optLhs=AF_MAT_NONE, const matProp optRhs=AF_MAT_NONE)
 Dot Product. More...
 
AFAPI array transpose (const array &in, const bool conjugate=false)
 Transposes a matrix. More...
 
AFAPI void transposeInPlace (array &in, const bool conjugate=false)
 Transposes a matrix in-place. More...
 
AFAPI int devicecount ()
 Gets the number of devices. More...
 
AFAPI int deviceget ()
 Gets the current device ID. More...
 
AFAPI void deviceset (const int device)
 Sets the current device. More...
 
AFAPI array loadimage (const char *filename, const bool is_color=false)
 C++ Interface for loading an image. More...
 
AFAPI void saveimage (const char *filename, const array &in)
 C++ Interface for saving an image. More...
 
AFAPI array gaussiankernel (const int rows, const int cols, const double sig_r=0, const double sig_c=0)
 Creates a Gaussian Kernel. More...
 
template<typename T >
alltrue (const array &in)
 C++ Interface for checking if all values in an array are true. More...
 
template<typename T >
anytrue (const array &in)
 C++ Interface for checking if all values in an array are true. More...
 
AFAPI array alltrue (const array &in, const int dim=-1)
 C++ Interface for checking all true values in an array. More...
 
AFAPI array anytrue (const array &in, const int dim=-1)
 C++ Interface for checking any true values in an array. More...
 
AFAPI array setunique (const array &in, const bool is_sorted=false)
 C++ Interface for getting unique values. More...
 
AFAPI array setunion (const array &first, const array &second, const bool is_unique=false)
 C++ Interface for finding the union of two arrays. More...
 
AFAPI array setintersect (const array &first, const array &second, const bool is_unique=false)
 C++ Interface for finding the intersection of two arrays. More...
 
AFAPI array histequal (const array &in, const array &hist)
 C++ Interface for histogram equalization. More...
 
AFAPI array colorspace (const array &image, const CSpace to, const CSpace from)
 C++ Interface wrapper for colorspace conversion. More...
 
AFAPI array filter (const array &image, const array &kernel)
 Image Filtering. 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...
 
AFAPI void deviceprop (char *d_name, char *d_platform, char *d_toolkit, char *d_compute)
 Gets the information about device and platform as strings. More...
 
AFAPI float real (af_cfloat val)
 
AFAPI double real (af_cdouble val)
 
AFAPI float imag (af_cfloat val)
 
AFAPI double imag (af_cdouble val)
 
AFAPI af::cfloat operator+ (const af::cfloat &lhs, const af::cfloat &rhs)
 
AFAPI af::cdouble operator+ (const af::cdouble &lhs, const af::cdouble &rhs)
 
AFAPI af::cfloat operator- (const af::cfloat &lhs, const af::cfloat &rhs)
 
AFAPI af::cdouble operator- (const af::cdouble &lhs, const af::cdouble &rhs)
 
AFAPI af::cfloat operator* (const af::cfloat &lhs, const af::cfloat &rhs)
 
AFAPI af::cdouble operator* (const af::cdouble &lhs, const af::cdouble &rhs)
 
AFAPI af::cfloat operator/ (const af::cfloat &lhs, const af::cfloat &rhs)
 
AFAPI af::cdouble operator/ (const af::cdouble &lhs, const af::cdouble &rhs)
 
AFAPI af::cfloat operator+ (const af::cfloat &lhs, const double &rhs)
 
AFAPI af::cdouble operator+ (const af::cdouble &lhs, const double &rhs)
 
AFAPI af::cfloat operator/ (const af::cfloat &lhs, const double &rhs)
 
AFAPI af::cdouble operator/ (const af::cdouble &lhs, const double &rhs)
 
AFAPI af::cfloat operator- (const af::cfloat &lhs, const double &rhs)
 
AFAPI af::cdouble operator- (const af::cdouble &lhs, const double &rhs)
 
AFAPI af::cfloat operator* (const af::cfloat &lhs, const double &rhs)
 
AFAPI af::cdouble operator* (const af::cdouble &lhs, const double &rhs)
 
AFAPI af::cfloat operator+ (const double &rhs, const af::cfloat &lhs)
 
AFAPI af::cdouble operator+ (const double &rhs, const af::cdouble &lhs)
 
AFAPI af::cdouble operator+ (const af::cfloat &lhs, const af::cdouble &rhs)
 
AFAPI af::cdouble operator+ (const af::cdouble &lhs, const af::cfloat &rhs)
 
AFAPI af::cfloat operator- (const double &rhs, const af::cfloat &lhs)
 
AFAPI af::cdouble operator- (const double &rhs, const af::cdouble &lhs)
 
AFAPI af::cdouble operator- (const af::cfloat &lhs, const af::cdouble &rhs)
 
AFAPI af::cdouble operator- (const af::cdouble &lhs, const af::cfloat &rhs)
 
AFAPI af::cfloat operator* (const double &rhs, const af::cfloat &lhs)
 
AFAPI af::cdouble operator* (const double &rhs, const af::cdouble &lhs)
 
AFAPI af::cdouble operator* (const af::cfloat &lhs, const af::cdouble &rhs)
 
AFAPI af::cdouble operator* (const af::cdouble &lhs, const af::cfloat &rhs)
 
AFAPI af::cfloat operator/ (const double &rhs, const af::cfloat &lhs)
 
AFAPI af::cdouble operator/ (const double &rhs, const af::cdouble &lhs)
 
AFAPI af::cdouble operator/ (const af::cfloat &lhs, const af::cdouble &rhs)
 
AFAPI af::cdouble operator/ (const af::cdouble &lhs, const af::cfloat &rhs)
 
AFAPI bool operator== (const cfloat &lhs, const cfloat &rhs)
 
AFAPI bool operator== (const cdouble &lhs, const cdouble &rhs)
 
AFAPI bool operator!= (const cfloat &lhs, const cfloat &rhs)
 
AFAPI bool operator!= (const cdouble &lhs, const cdouble &rhs)
 
AFAPI std::istream & operator>> (std::istream &is, cfloat &in)
 
AFAPI std::istream & operator>> (std::istream &is, cdouble &in)
 
AFAPI std::ostream & operator<< (std::ostream &os, const cfloat &in)
 
AFAPI std::ostream & operator<< (std::ostream &os, const cdouble &in)
 
AFAPI float abs (const cfloat &val)
 
AFAPI double abs (const cdouble &val)
 
AFAPI cfloat conj (const cfloat &val)
 
AFAPI cdouble conj (const cdouble &val)
 
template<typename T >
array constant (T val, const dim4 &dims, const dtype ty=(af_dtype) dtype_traits< T >::ctype)
 
template<typename T >
array constant (T val, const dim_t d0, const af_dtype ty=(af_dtype) dtype_traits< T >::ctype)
 
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)
 
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)
 
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)
 
AFAPI array identity (const dim4 &dims, const dtype ty=f32)
 
AFAPI array identity (const dim_t d0, const dtype ty=f32)
 
AFAPI array identity (const dim_t d0, const dim_t d1, const dtype ty=f32)
 
AFAPI array identity (const dim_t d0, const dim_t d1, const dim_t d2, const dtype ty=f32)
 
AFAPI array identity (const dim_t d0, const dim_t d1, const dim_t d2, const dim_t d3, const dtype ty=f32)
 
AFAPI array range (const dim4 &dims, const int seq_dim=-1, const dtype ty=f32)
 
AFAPI array range (const dim_t d0, const dim_t d1=1, const dim_t d2=1, const dim_t d3=1, const int seq_dim=-1, const dtype ty=f32)
 
AFAPI array iota (const dim4 &dims, const dim4 &tile_dims=dim4(1), const dtype ty=f32)
 
AFAPI array diag (const array &in, const int num=0, const bool extract=true)
 
AFAPI array join (const int dim, const array &first, const array &second)
 Join 2 arrays along dim. More...
 
AFAPI array join (const int dim, const array &first, const array &second, const array &third)
 Join 3 arrays along dim. More...
 
AFAPI array join (const int dim, const array &first, const array &second, const array &third, const array &fourth)
 Join 4 arrays along dim. More...
 
AFAPI array tile (const array &in, const unsigned x, const unsigned y=1, const unsigned z=1, const unsigned w=1)
 
AFAPI array tile (const array &in, const dim4 &dims)
 
AFAPI array reorder (const array &in, const unsigned x, const unsigned y=1, const unsigned z=2, const unsigned w=3)
 
AFAPI array shift (const array &in, const int x, const int y=0, const int z=0, const int w=0)
 
AFAPI array moddims (const array &in, const unsigned ndims, const dim_t *const dims)
 
AFAPI array moddims (const array &in, const dim4 &dims)
 
AFAPI array moddims (const array &in, const dim_t d0, const dim_t d1=1, const dim_t d2=1, const dim_t d3=1)
 
AFAPI array flat (const array &in)
 
AFAPI array flip (const array &in, const unsigned dim)
 
AFAPI array lower (const array &in, bool is_unit_diag=false)
 
AFAPI array upper (const array &in, bool is_unit_diag=false)
 
AFAPI array select (const array &cond, const array &a, const array &b)
 
AFAPI array select (const array &cond, const array &a, const double &b)
 
AFAPI array select (const array &cond, const double &a, const array &b)
 
AFAPI void replace (array &a, const array &cond, const array &b)
 
AFAPI void replace (array &a, const array &cond, const double &b)
 
AFAPI array pad (const array &in, const dim4 &beginPadding, const dim4 &endPadding, const borderType padFillType)
 
AFAPI void info ()
 
AFAPI const char * infoString (const bool verbose=false)
 
AFAPI void deviceInfo (char *d_name, char *d_platform, char *d_toolkit, char *d_compute)
 Gets the information about device and platform as strings. More...
 
AFAPI int getDeviceCount ()
 Gets the number of devices. More...
 
AFAPI int getDevice ()
 Gets the current device ID. More...
 
AFAPI bool isDoubleAvailable (const int device)
 Queries the current device for double precision floating point support. More...
 
AFAPI bool isHalfAvailable (const int device)
 Queries the current device for half precision floating point support. More...
 
AFAPI void setDevice (const int device)
 Sets the current device. More...
 
AFAPI void sync (const int device=-1)
 Blocks until the device is finished processing. More...
 
AFAPI void free (const void *ptr)
 Returns memory to ArrayFire's memory manager. The memory will return to the memory pool. More...
 
AFAPI void freePinned (const void *ptr)
 Free pinned memory allocated by ArrayFire's memory manager. More...
 
AFAPI void * allocHost (const size_t elements, const dtype type)
 Allocate memory on host. More...
 
template<typename T >
AFAPI T * allocHost (const size_t elements)
 Allocate memory on host. More...
 
AFAPI void freeHost (const void *ptr)
 Free memory allocated internally by ArrayFire. More...
 
AFAPI void setMemStepSize (const size_t size)
 Set the resolution of memory chunks. More...
 
AFAPI size_t getMemStepSize ()
 Get the resolution of memory chunks. More...
 
AFAPI dim4 operator+ (const dim4 &first, const dim4 &second)
 Performs an element-wise addition of two dim4 objects. More...
 
AFAPI dim4 operator- (const dim4 &first, const dim4 &second)
 Performs an element-wise subtraction of two dim4 objects. More...
 
AFAPI dim4 operator* (const dim4 &first, const dim4 &second)
 Performs an element-wise multiplication of two dim4 objects. More...
 
static std::ostream & operator<< (std::ostream &ostr, const dim4 &dims)
 Prints the elements of the dim4 array separated by spaces. More...
 
static std::istream & operator>> (std::istream &istr, dim4 &dims)
 Reads 4 dim_t values from an input stream and stores the results in a dim4. More...
 
AFAPI bool isSpan (const af_seq &seq)
 Returns true if the af_seq object represents the entire range of an axis. More...
 
AFAPI size_t seqElements (const af_seq &seq)
 Returns the number of elements that the af_seq object represents. More...
 
AFAPI dim_t calcDim (const af_seq &seq, const dim_t &parentDim)
 Returns the number of elements that will be represented by seq if applied on an array. More...
 
AFAPI bool gforToggle ()
 
AFAPI bool gforGet ()
 
AFAPI void gforSet (bool val)
 
AFAPI array batchFunc (const array &lhs, const array &rhs, batchFunc_t func)
 
AFAPI void grad (array &dx, array &dy, const array &in)
 C++ Interface for calculating the gradients. More...
 
AFAPI array loadImage (const char *filename, const bool is_color=false)
 C++ Interface for loading an image. More...
 
AFAPI void saveImage (const char *filename, const array &in)
 C++ Interface for saving an image. More...
 
AFAPI array loadImageMem (const void *ptr)
 C++ Interface for loading an image from memory. More...
 
AFAPI void * saveImageMem (const array &in, const imageFormat format=AF_FIF_PNG)
 C++ Interface for saving an image to memory. More...
 
AFAPI void deleteImageMem (void *ptr)
 C++ Interface for deleting memory created by saveImageMem or af_save_image_memory. More...
 
AFAPI array loadImageNative (const char *filename)
 C++ Interface for loading an image as its original type. More...
 
AFAPI void saveImageNative (const char *filename, const array &in)
 C++ Interface for saving an image without modifications. More...
 
AFAPI bool isImageIOAvailable ()
 Function to check if Image IO is available. More...
 
AFAPI array resize (const array &in, const dim_t odim0, const dim_t odim1, const interpType method=AF_INTERP_NEAREST)
 C++ Interface for resizing an image to specified dimensions. More...
 
AFAPI array resize (const float scale0, const float scale1, const array &in, const interpType method=AF_INTERP_NEAREST)
 C++ Interface for resizing an image to specified scales. More...
 
AFAPI array resize (const float scale, const array &in, const interpType method=AF_INTERP_NEAREST)
 C++ Interface for resizing an image to specified scale. More...
 
AFAPI array rotate (const array &in, const float theta, const bool crop=true, const interpType method=AF_INTERP_NEAREST)
 C++ Interface for rotating an image. More...
 
AFAPI array transform (const array &in, const array &transform, const dim_t odim0=0, const dim_t odim1=0, const interpType method=AF_INTERP_NEAREST, const bool inverse=true)
 C++ Interface for transforming an image. More...
 
AFAPI array transformCoordinates (const array &tf, const float d0, const float d1)
 C++ Interface for transforming coordinates. More...
 
AFAPI array translate (const array &in, const float trans0, const float trans1, const dim_t odim0=0, const dim_t odim1=0, const interpType method=AF_INTERP_NEAREST)
 C++ Interface for translating an image. More...
 
AFAPI array scale (const array &in, const float scale0, const float scale1, const dim_t odim0=0, const dim_t odim1=0, const interpType method=AF_INTERP_NEAREST)
 C++ Interface for scaling an image. More...
 
AFAPI array skew (const array &in, const float skew0, const float skew1, const dim_t odim0=0, const dim_t odim1=0, const bool inverse=true, const interpType method=AF_INTERP_NEAREST)
 C++ Interface for skewing an image. More...
 
AFAPI array bilateral (const array &in, const float spatial_sigma, const float chromatic_sigma, const bool is_color=false)
 C++ Interface for bilateral filter. More...
 
AFAPI array histogram (const array &in, const unsigned nbins, const double minval, const double maxval)
 C++ Interface for histogram. More...
 
AFAPI array histogram (const array &in, const unsigned nbins)
 C++ Interface for histogram. More...
 
AFAPI array meanShift (const array &in, const float spatial_sigma, const float chromatic_sigma, const unsigned iter, const bool is_color=false)
 C++ Interface for mean shift. More...
 
AFAPI array minfilt (const array &in, const dim_t wind_length=3, const dim_t wind_width=3, const borderType edge_pad=AF_PAD_ZERO)
 C++ Interface for minimum filter. More...
 
AFAPI array maxfilt (const array &in, const dim_t wind_length=3, const dim_t wind_width=3, const borderType edge_pad=AF_PAD_ZERO)
 C++ Interface for maximum filter. More...
 
AFAPI array dilate (const array &in, const array &mask)
 C++ Interface for image dilation (max filter) More...
 
AFAPI array dilate3 (const array &in, const array &mask)
 C++ Interface for 3D image dilation. More...
 
AFAPI array erode (const array &in, const array &mask)
 C++ Interface for image erosion (min filter) More...
 
AFAPI array erode3 (const array &in, const array &mask)
 C++ Interface for 3d for image erosion. More...
 
AFAPI array regions (const array &in, const af::connectivity connectivity=AF_CONNECTIVITY_4, const dtype type=f32)
 C++ Interface for getting regions in an image. More...
 
AFAPI void sobel (array &dx, array &dy, const array &img, const unsigned ker_size=3)
 C++ Interface for extracting sobel gradients. More...
 
AFAPI array sobel (const array &img, const unsigned ker_size=3, const bool isFast=false)
 C++ Interface for sobel filtering. More...
 
AFAPI array rgb2gray (const array &in, const float rPercent=0.2126f, const float gPercent=0.7152f, const float bPercent=0.0722f)
 C++ Interface for RGB to gray conversion. More...
 
AFAPI array gray2rgb (const array &in, const float rFactor=1.0, const float gFactor=1.0, const float bFactor=1.0)
 C++ Interface for gray to RGB conversion. More...
 
AFAPI array histEqual (const array &in, const array &hist)
 C++ Interface for histogram equalization. More...
 
AFAPI array gaussianKernel (const int rows, const int cols, const double sig_r=0, const double sig_c=0)
 C++ Interface for generating gausian kernels. More...
 
AFAPI array hsv2rgb (const array &in)
 C++ Interface for converting HSV to RGB. More...
 
AFAPI array rgb2hsv (const array &in)
 C++ Interface for converting RGB to HSV. More...
 
AFAPI array colorSpace (const array &image, const CSpace to, const CSpace from)
 C++ Interface wrapper for colorspace conversion. More...
 
AFAPI array unwrap (const array &in, const dim_t wx, const dim_t wy, const dim_t sx, const dim_t sy, const dim_t px=0, const dim_t py=0, const bool is_column=true)
 C++ Interface for rearranging windowed sections of an input into columns (or rows) More...
 
AFAPI array wrap (const array &in, const dim_t ox, const dim_t oy, const dim_t wx, const dim_t wy, const dim_t sx, const dim_t sy, const dim_t px=0, const dim_t py=0, const bool is_column=true)
 C++ Interface for performing the opposite of unwrap() More...
 
AFAPI array sat (const array &in)
 C++ Interface wrapper for summed area tables. More...
 
AFAPI array ycbcr2rgb (const array &in, const YCCStd standard=AF_YCC_601)
 C++ Interface for converting YCbCr to RGB. More...
 
AFAPI array rgb2ycbcr (const array &in, const YCCStd standard=AF_YCC_601)
 C++ Interface for converting RGB to YCbCr. More...
 
AFAPI void moments (double *out, const array &in, const momentType moment=AF_MOMENT_FIRST_ORDER)
 C++ Interface for calculating an image moment. More...
 
AFAPI array moments (const array &in, const momentType moment=AF_MOMENT_FIRST_ORDER)
 C++ Interface for calculating image moments. More...
 
AFAPI array canny (const array &in, const cannyThreshold thresholdType, const float lowThresholdRatio, const float highThresholdRatio, const unsigned sobelWindow=3, const bool isFast=false)
 C++ Interface for canny edge detector. More...
 
AFAPI array anisotropicDiffusion (const af::array &in, const float timestep, const float conductance, const unsigned iterations, const fluxFunction fftype=AF_FLUX_EXPONENTIAL, const diffusionEq diffusionKind=AF_DIFFUSION_GRAD)
 C++ Interface for gradient anisotropic(non-linear diffusion) smoothing. More...
 
AFAPI array iterativeDeconv (const array &in, const array &ker, const unsigned iterations, const float relaxFactor, const iterativeDeconvAlgo algo)
 C++ Interface for Iterative deconvolution algorithm. More...
 
AFAPI array inverseDeconv (const array &in, const array &psf, const float gamma, const inverseDeconvAlgo algo)
 C++ Interface for Tikhonov deconvolution algorithm. More...
 
AFAPI array confidenceCC (const array &in, const array &seeds, const unsigned radius, const unsigned multiplier, const int iter, const double segmentedValue)
 C++ Interface for confidence connected components. More...
 
AFAPI array confidenceCC (const array &in, const array &seedx, const array &seedy, const unsigned radius, const unsigned multiplier, const int iter, const double segmentedValue)
 C++ Interface for confidence connected components. More...
 
AFAPI array confidenceCC (const array &in, const size_t num_seeds, const unsigned *seedx, const unsigned *seedy, const unsigned radius, const unsigned multiplier, const int iter, const double segmentedValue)
 C++ Interface for confidence connected components. More...
 
AFAPI array lookup (const array &in, const array &idx, const int dim=-1)
 Lookup the values of an input array by indexing with another array. More...
 
AFAPI void copy (array &dst, const array &src, const index &idx0, const index &idx1=span, const index &idx2=span, const index &idx3=span)
 Copy the values of an input array based on index. More...
 
AFAPI array createStridedArray (const void *data, const dim_t offset, const dim4 dims, const dim4 strides, const af::dtype ty, const af::source location)
 
AFAPI dim4 getStrides (const array &in)
 
AFAPI dim_t getOffset (const array &in)
 
AFAPI void * getRawPtr (const array &in)
 
AFAPI bool isLinear (const array &in)
 
AFAPI bool isOwner (const array &in)
 
AFAPI void svd (array &u, array &s, array &vt, const array &in)
 C++ Interface for SVD decomposition. More...
 
AFAPI void svdInPlace (array &u, array &s, array &vt, array &in)
 C++ Interface for SVD decomposition (in-place) More...
 
AFAPI void lu (array &out, array &pivot, const array &in, const bool is_lapack_piv=true)
 C++ Interface for LU decomposition in packed format. More...
 
AFAPI void lu (array &lower, array &upper, array &pivot, const array &in)
 C++ Interface for LU decomposition. More...
 
AFAPI void luInPlace (array &pivot, array &in, const bool is_lapack_piv=true)
 C++ Interface for in place LU decomposition. More...
 
AFAPI void qr (array &out, array &tau, const array &in)
 C++ Interface for QR decomposition in packed format. More...
 
AFAPI void qr (array &q, array &r, array &tau, const array &in)
 C++ Interface for QR decomposition. More...
 
AFAPI void qrInPlace (array &tau, array &in)
 C++ Interface for QR decomposition. More...
 
AFAPI int cholesky (array &out, const array &in, const bool is_upper=true)
 C++ Interface for cholesky decomposition. More...
 
AFAPI int choleskyInPlace (array &in, const bool is_upper=true)
 C++ Interface for in place cholesky decomposition. More...
 
AFAPI array solve (const array &a, const array &b, const matProp options=AF_MAT_NONE)
 C++ Interface for solving a system of equations. More...
 
AFAPI array solveLU (const array &a, const array &piv, const array &b, const matProp options=AF_MAT_NONE)
 C++ Interface for solving a system of equations. More...
 
AFAPI array inverse (const array &in, const matProp options=AF_MAT_NONE)
 C++ Interface for inverting a matrix. More...
 
AFAPI array pinverse (const array &in, const double tol=1E-6, const matProp options=AF_MAT_NONE)
 C++ Interface for pseudo-inverting (Moore-Penrose) a matrix. More...
 
AFAPI unsigned rank (const array &in, const double tol=1E-5)
 C++ Interface for finding the rank of a matrix. More...
 
template<typename T >
det (const array &in)
 C++ Interface for finding the determinant of a matrix. More...
 
AFAPI double norm (const array &in, const normType type=AF_NORM_EUCLID, const double p=1, const double q=1)
 C++ Interface for norm of a matrix. More...
 
AFAPI bool isLAPACKAvailable ()
 Returns true is ArrayFire is compiled with LAPACK support. More...
 
AFAPI array convolve2GradientNN (const array &incoming_gradient, const array &original_signal, const array &original_filter, const array &convolved_output, const dim4 stride, const dim4 padding, const dim4 dilation, convGradientType grad_type)
 C++ interface for calculating backward pass gradient of 2D convolution This function calculates the gradient with respect to the output of the convolve2NN() function that uses the machine learning formulation for the dimensions of the signals and filters. More...
 
AFAPI array randu (const dim4 &dims, const dtype ty, randomEngine &r)
 
AFAPI array randn (const dim4 &dims, const dtype ty, randomEngine &r)
 
AFAPI array randu (const dim4 &dims, const dtype ty=f32)
 
AFAPI array randu (const dim_t d0, const dtype ty=f32)
 
AFAPI array randu (const dim_t d0, const dim_t d1, const dtype ty=f32)
 
AFAPI array randu (const dim_t d0, const dim_t d1, const dim_t d2, const dtype ty=f32)
 
AFAPI array randu (const dim_t d0, const dim_t d1, const dim_t d2, const dim_t d3, const dtype ty=f32)
 
AFAPI array randn (const dim4 &dims, const dtype ty=f32)
 
AFAPI array randn (const dim_t d0, const dtype ty=f32)
 
AFAPI array randn (const dim_t d0, const dim_t d1, const dtype ty=f32)
 
AFAPI array randn (const dim_t d0, const dim_t d1, const dim_t d2, const dtype ty=f32)
 
AFAPI array randn (const dim_t d0, const dim_t d1, const dim_t d2, const dim_t d3, const dtype ty=f32)
 
AFAPI void setDefaultRandomEngineType (randomEngineType rtype)
 
AFAPI randomEngine getDefaultRandomEngine (void)
 
AFAPI void setSeed (const unsigned long long seed)
 Sets the seed of the default random number generator. More...
 
AFAPI unsigned long long getSeed ()
 Gets the seed of the default random number generator. More...
 
AFAPI array approx1 (const array &in, const array &pos, const interpType method=AF_INTERP_LINEAR, const float off_grid=0.0f)
 C++ Interface for data interpolation on one-dimensional signals. More...
 
AFAPI array approx2 (const array &in, const array &pos0, const array &pos1, const interpType method=AF_INTERP_LINEAR, const float off_grid=0.0f)
 C++ Interface for data interpolation on two-dimensional signals. More...
 
AFAPI array approx1 (const array &in, const array &pos, const int interp_dim, const double idx_start, const double idx_step, const interpType method=AF_INTERP_LINEAR, const float off_grid=0.0f)
 C++ Interface for data interpolation on one-dimensional signals. More...
 
AFAPI array approx2 (const array &in, const array &pos0, const int interp_dim0, const double idx_start_dim0, const double idx_step_dim0, const array &pos1, const int interp_dim1, const double idx_start_dim1, const double idx_step_dim1, const interpType method=AF_INTERP_LINEAR, const float off_grid=0.0f)
 C++ Interface for data interpolation on two-dimensional signals. More...
 
AFAPI array fftNorm (const array &in, const double norm_factor, const dim_t odim0=0)
 C++ Interface for fast fourier transform on one dimensional signals. More...
 
AFAPI array fft2Norm (const array &in, const double norm_factor, const dim_t odim0=0, const dim_t odim1=0)
 C++ Interface for fast fourier transform on two dimensional signals. More...
 
AFAPI array fft3Norm (const array &in, const double norm_factor, const dim_t odim0=0, const dim_t odim1=0, const dim_t odim2=0)
 C++ Interface for fast fourier transform on three dimensional signals. More...
 
AFAPI void fftInPlace (array &in, const double norm_factor=1)
 C++ Interface for fast fourier transform on one dimensional signals. More...
 
AFAPI void fft2InPlace (array &in, const double norm_factor=1)
 C++ Interface for fast fourier transform on two dimensional signals. More...
 
AFAPI void fft3InPlace (array &in, const double norm_factor=1)
 C++ Interface for fast fourier transform on three dimensional signals. More...
 
AFAPI array fft (const array &in, const dim_t odim0=0)
 C++ Interface for fast fourier transform on one dimensional signals. More...
 
AFAPI array fft2 (const array &in, const dim_t odim0=0, const dim_t odim1=0)
 C++ Interface for fast fourier transform on two dimensional signals. More...
 
AFAPI array fft3 (const array &in, const dim_t odim0=0, const dim_t odim1=0, const dim_t odim2=0)
 C++ Interface for fast fourier transform on three dimensional signals. More...
 
AFAPI array dft (const array &in, const double norm_factor, const dim4 outDims)
 C++ Interface for fast fourier transform on any(1d, 2d, 3d) dimensional signals. More...
 
AFAPI array dft (const array &in, const dim4 outDims)
 C++ Interface for fast fourier transform on any(1d, 2d, 3d) dimensional signals. More...
 
AFAPI array dft (const array &in)
 C++ Interface for fast fourier transform on any(1d, 2d, 3d) dimensional signals. More...
 
AFAPI array ifftNorm (const array &in, const double norm_factor, const dim_t odim0=0)
 C++ Interface for inverse fast fourier transform on one dimensional signals. More...
 
AFAPI array ifft2Norm (const array &in, const double norm_factor, const dim_t odim0=0, const dim_t odim1=0)
 C++ Interface for inverse fast fourier transform on two dimensional signals. More...
 
AFAPI array ifft3Norm (const array &in, const double norm_factor, const dim_t odim0=0, const dim_t odim1=0, const dim_t odim2=0)
 C++ Interface for inverse fast fourier transform on three dimensional signals. More...
 
AFAPI void ifftInPlace (array &in, const double norm_factor=1)
 C++ Interface for fast fourier transform on one dimensional signals. More...
 
AFAPI void ifft2InPlace (array &in, const double norm_factor=1)
 C++ Interface for fast fourier transform on two dimensional signals. More...
 
AFAPI void ifft3InPlace (array &in, const double norm_factor=1)
 C++ Interface for fast fourier transform on three dimensional signals. More...
 
AFAPI array ifft (const array &in, const dim_t odim0=0)
 C++ Interface for inverse fast fourier transform on one dimensional signals. More...
 
AFAPI array ifft2 (const array &in, const dim_t odim0=0, const dim_t odim1=0)
 C++ Interface for inverse fast fourier transform on two dimensional signals. More...
 
AFAPI array ifft3 (const array &in, const dim_t odim0=0, const dim_t odim1=0, const dim_t odim2=0)
 C++ Interface for inverse fast fourier transform on three dimensional signals. More...
 
AFAPI array idft (const array &in, const double norm_factor, const dim4 outDims)
 C++ Interface for inverse fast fourier transform on any(1d, 2d, 3d) dimensional signals. More...
 
AFAPI array idft (const array &in, const dim4 outDims)
 C++ Interface for inverse fast fourier transform on any(1d, 2d, 3d) dimensional signals. More...
 
AFAPI array idft (const array &in)
 C++ Interface for inverse fast fourier transform on any(1d, 2d, 3d) dimensional signals. More...
 
template<int rank>
array fftR2C (const array &in, const dim4 &dims, const double norm_factor=0)
 C++ Interface for real to complex fast fourier transform for one dimensional signals. More...
 
template<int rank>
array fftR2C (const array &in, const double norm_factor=0)
 C++ Interface for real to complex fast fourier transform for one dimensional signals. More...
 
template<int rank>
array fftC2R (const array &in, bool is_odd=false, const double norm_factor=0)
 C++ Interface for complex to real fast fourier transform. More...
 
AFAPI array convolve (const array &signal, const array &filter, const convMode mode=AF_CONV_DEFAULT, const convDomain domain=AF_CONV_AUTO)
 C++ Interface for convolution any(one through three) dimensional signals. More...
 
AFAPI array convolve (const array &col_filter, const array &row_filter, const array &signal, const convMode mode=AF_CONV_DEFAULT)
 C++ Interface for separable convolution on two dimensional signals. More...
 
AFAPI array convolve1 (const array &signal, const array &filter, const convMode mode=AF_CONV_DEFAULT, const convDomain domain=AF_CONV_AUTO)
 C++ Interface for convolution on one dimensional signals. More...
 
AFAPI array convolve2 (const array &signal, const array &filter, const convMode mode=AF_CONV_DEFAULT, const convDomain domain=AF_CONV_AUTO)
 C++ Interface for convolution on two dimensional signals. More...
 
AFAPI array convolve2NN (const array &signal, const array &filter, const dim4 stride, const dim4 padding, const dim4 dilation)
 C++ Interface for 2D convolution. More...
 
AFAPI array convolve3 (const array &signal, const array &filter, const convMode mode=AF_CONV_DEFAULT, const convDomain domain=AF_CONV_AUTO)
 C++ Interface for convolution on three dimensional signals. More...
 
AFAPI array fftConvolve (const array &signal, const array &filter, const convMode mode=AF_CONV_DEFAULT)
 C++ Interface for FFT-based convolution any(one through three) dimensional signals. More...
 
AFAPI array fftConvolve1 (const array &signal, const array &filter, const convMode mode=AF_CONV_DEFAULT)
 C++ Interface for convolution on 1D signals using FFT. More...
 
AFAPI array fftConvolve2 (const array &signal, const array &filter, const convMode mode=AF_CONV_DEFAULT)
 C++ Interface for convolution on 2D signals using FFT. More...
 
AFAPI array fftConvolve3 (const array &signal, const array &filter, const convMode mode=AF_CONV_DEFAULT)
 C++ Interface for convolution on 3D signals using FFT. More...
 
AFAPI array fir (const array &b, const array &x)
 C++ Interface for finite impulse response filter. More...
 
AFAPI array iir (const array &b, const array &a, const array &x)
 C++ Interface for infinite impulse response filter. More...
 
AFAPI array medfilt (const array &in, const dim_t wind_length=3, const dim_t wind_width=3, const borderType edge_pad=AF_PAD_ZERO)
 C++ Interface for median filter. More...
 
AFAPI array medfilt1 (const array &in, const dim_t wind_width=3, const borderType edge_pad=AF_PAD_ZERO)
 C++ Interface for median filter. More...
 
AFAPI array medfilt2 (const array &in, const dim_t wind_length=3, const dim_t wind_width=3, const borderType edge_pad=AF_PAD_ZERO)
 C++ Interface for median filter. More...
 
AFAPI void setFFTPlanCacheSize (size_t cacheSize)
 C++ Interface for setting plan cache size. More...
 
AFAPI array sparse (const dim_t nRows, const dim_t nCols, const array values, const array rowIdx, const array colIdx, const af::storage stype=AF_STORAGE_CSR)
 This function converts af::array of values, row indices and column indices into a sparse array. More...
 
AFAPI array sparse (const dim_t nRows, const dim_t nCols, const dim_t nNZ, const void *const values, const int *const rowIdx, const int *const colIdx, const dtype type=f32, const af::storage stype=AF_STORAGE_CSR, const af::source src=afHost)
 This function converts host or device arrays of values, row indices and column indices into a sparse array on the device. More...
 
AFAPI array sparse (const array dense, const af::storage stype=AF_STORAGE_CSR)
 This function converts a dense af::array into a sparse array. More...
 
AFAPI array sparseConvertTo (const array in, const af::storage destStrorage)
 
AFAPI array dense (const array sparse)
 
AFAPI void sparseGetInfo (array &values, array &rowIdx, array &colIdx, af::storage &stype, const array in)
 
AFAPI array sparseGetValues (const array in)
 
AFAPI array sparseGetRowIdx (const array in)
 
AFAPI array sparseGetColIdx (const array in)
 
AFAPI dim_t sparseGetNNZ (const array in)
 
AFAPI af::storage sparseGetStorage (const array in)
 
AFAPI array mean (const array &in, const dim_t dim=-1)
 C++ Interface for mean. More...
 
AFAPI array mean (const array &in, const array &weights, const dim_t dim=-1)
 C++ Interface for mean of weighted inputs. More...
 
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...
 
AFAPI void meanvar (array &mean, array &var, const array &in, const array &weights, const af_var_bias bias=AF_VARIANCE_POPULATION, const dim_t dim=-1)
 C++ Interface for mean and variance. More...
 
AFAPI array stdev (const array &in, const dim_t dim=-1)
 C++ Interface for standard deviation. More...
 
AFAPI array cov (const array &X, const array &Y, const bool isbiased=false)
 C++ Interface for covariance. More...
 
AFAPI array median (const array &in, const dim_t dim=-1)
 C++ Interface for median. More...
 
template<typename T >
AFAPImean (const array &in)
 C++ Interface for mean of all elements. More...
 
template<typename T >
AFAPImean (const array &in, const array &weights)
 C++ Interface for mean of all elements in weighted input. 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...
 
template<typename T >
AFAPIstdev (const array &in)
 C++ Interface for standard deviation of all elements. More...
 
template<typename T >
AFAPImedian (const array &in)
 C++ Interface for median of all elements. More...
 
template<typename T >
AFAPIcorrcoef (const array &X, const array &Y)
 C++ Interface for correlation coefficient. More...
 
AFAPI void topk (array &values, array &indices, const array &in, const int k, const int dim=-1, const topkFunction order=AF_TOPK_MAX)
 C++ Interface for finding top k elements along a given dimension. More...
 
AFAPI double timeit (void(*fn)())
 
AFAPI void print (const char *exp, const array &arr)
 
AFAPI void print (const char *exp, const array &arr, const int precision)
 
AFAPI int saveArray (const char *key, const array &arr, const char *filename, const bool append=false)
 
AFAPI array readArray (const char *filename, const unsigned index)
 
AFAPI array readArray (const char *filename, const char *key)
 
AFAPI int readArrayCheck (const char *filename, const char *key)
 When reading by key, it may be a good idea to run this function first to check for the key and then call the readArray using the index. More...
 
AFAPI void toString (char **output, const char *exp, const array &arr, const int precision=4, const bool transpose=true)
 
AFAPI const char * toString (const char *exp, const array &arr, const int precision=4, const bool transpose=true)
 
AFAPI array exampleFunction (const array &in, const af_someenum_t param)
 
AFAPI size_t getSizeOf (af::dtype type)
 Get the size of the type represented by an af_dtype enum. More...
 
AFAPI features fast (const array &in, const float thr=20.0f, const unsigned arc_length=9, const bool non_max=true, const float feature_ratio=0.05f, const unsigned edge=3)
 C++ Interface for FAST feature detector. More...
 
AFAPI features harris (const array &in, const unsigned max_corners=500, const float min_response=1e5f, const float sigma=1.f, const unsigned block_size=0, const float k_thr=0.04f)
 C++ Interface for Harris corner detector. More...
 
AFAPI void orb (features &feat, array &desc, const array &image, const float fast_thr=20.f, const unsigned max_feat=400, const float scl_fctr=1.5f, const unsigned levels=4, const bool blur_img=false)
 C++ Interface for ORB feature descriptor. More...
 
AFAPI void sift (features &feat, array &desc, const array &in, const unsigned n_layers=3, const float contrast_thr=0.04f, const float edge_thr=10.f, const float init_sigma=1.6f, const bool double_input=true, const float intensity_scale=0.00390625f, const float feature_ratio=0.05f)
 C++ Interface for SIFT feature detector and descriptor. More...
 
AFAPI void gloh (features &feat, array &desc, const array &in, const unsigned n_layers=3, const float contrast_thr=0.04f, const float edge_thr=10.f, const float init_sigma=1.6f, const bool double_input=true, const float intensity_scale=0.00390625f, const float feature_ratio=0.05f)
 C++ Interface for SIFT feature detector and GLOH descriptor. More...
 
AFAPI void hammingMatcher (array &idx, array &dist, const array &query, const array &train, const dim_t dist_dim=0, const unsigned n_dist=1)
 C++ Interface wrapper for Hamming matcher. More...
 
AFAPI void nearestNeighbour (array &idx, array &dist, const array &query, const array &train, const dim_t dist_dim=0, const unsigned n_dist=1, const af_match_type dist_type=AF_SSD)
 C++ interface wrapper for determining the nearest neighbouring points to a given set of points. More...
 
AFAPI array matchTemplate (const array &searchImg, const array &templateImg, const matchType mType=AF_SAD)
 C++ Interface for image template matching. More...
 
AFAPI features susan (const array &in, const unsigned radius=3, const float diff_thr=32.0f, const float geom_thr=10.0f, const float feature_ratio=0.05f, const unsigned edge=3)
 C++ Interface for SUSAN corner detector. More...
 
AFAPI array dog (const array &in, const int radius1, const int radius2)
 C++ Interface wrapper for Difference of Gaussians. More...
 
AFAPI void homography (array &H, int &inliers, const array &x_src, const array &y_src, const array &x_dst, const array &y_dst, const af_homography_type htype=AF_HOMOGRAPHY_RANSAC, const float inlier_thr=3.f, const unsigned iterations=1000, const dtype otype=f32)
 C++ Interface for Homography estimation. More...
 

Variables

AFAPI const double NaN
 
AFAPI const double Inf
 
AFAPI const double Pi
 
AFAPI int end
 A special value representing the last value of an axis. More...
 
AFAPI seq span
 A special value representing the entire axis of an af::array. More...
 

Typedef Documentation

◆ af_cdouble

typedef struct af::af_cdouble af_cdouble

◆ af_cfloat

typedef struct af::af_cfloat af_cfloat

◆ Backend

Definition at line 570 of file defines.h.

◆ batchFunc_t

typedef array(* batchFunc_t) (const array &lhs, const array &rhs)

Definition at line 35 of file gfor.h.

◆ binaryOp

Definition at line 582 of file defines.h.

◆ borderType

Definition at line 552 of file defines.h.

◆ cannyThreshold

Definition at line 588 of file defines.h.

◆ cdouble

Definition at line 52 of file complex.h.

◆ cfloat

Definition at line 51 of file complex.h.

◆ ColorMap

Definition at line 561 of file defines.h.

◆ connectivity

Definition at line 553 of file defines.h.

◆ convDomain

Definition at line 559 of file defines.h.

◆ convGradientType

Definition at line 599 of file defines.h.

◆ convMode

Definition at line 558 of file defines.h.

◆ CSpace

Definition at line 555 of file defines.h.

◆ diffusionEq

Definition at line 592 of file defines.h.

◆ dtype

typedef af_dtype dtype
Examples
benchmarks/blas.cpp.

Definition at line 549 of file defines.h.

◆ fluxFunction

Definition at line 591 of file defines.h.

◆ half

typedef af_half half

Definition at line 26 of file half.h.

◆ imageFormat

Definition at line 567 of file defines.h.

◆ interpType

Definition at line 551 of file defines.h.

◆ inverseDeconvAlgo

Definition at line 598 of file defines.h.

◆ iterativeDeconvAlgo

Definition at line 597 of file defines.h.

◆ markerType

Definition at line 573 of file defines.h.

◆ matchType

Definition at line 554 of file defines.h.

◆ matProp

Definition at line 560 of file defines.h.

◆ momentType

Definition at line 576 of file defines.h.

◆ normType

Definition at line 562 of file defines.h.

◆ randomEngineType

Definition at line 585 of file defines.h.

◆ SomeEnum

Definition at line 556 of file defines.h.

◆ source

typedef af_source source

Definition at line 550 of file defines.h.

◆ storage

Definition at line 579 of file defines.h.

◆ timer

typedef struct af::timer timer

Internal timer object.

◆ topkFunction

Definition at line 593 of file defines.h.

◆ trans

typedef af_mat_prop trans

Definition at line 557 of file defines.h.

◆ varBias

Definition at line 596 of file defines.h.

◆ YCCStd

typedef af_ycc_std YCCStd

Definition at line 564 of file defines.h.

Function Documentation

◆ abs() [1/2]

AFAPI double af::abs ( const cdouble val)

◆ abs() [2/2]

AFAPI float af::abs ( const cfloat val)

◆ allTrueByKey()

AFAPI void af::allTrueByKey ( array keys_out,
array vals_out,
const array keys,
const array vals,
const int  dim = -1 
)

C++ Interface for checking all true values in an array according to a key.

Parameters
[out]keys_outwill contain the reduced keys in vals along dim
[out]vals_outwill contain the reduced and of all values in vals along dim according to keys
[in]keysis the key array
[in]valsis the array containing the values to be reduced
[in]dimThe dimension along which the all true operation occurs
Note
dim is -1 by default. -1 denotes the first non-singleton dimension.
NaN values are ignored

◆ batchFunc()

AFAPI array af::batchFunc ( const array lhs,
const array rhs,
batchFunc_t  func 
)

◆ calcDim()

AFAPI dim_t af::calcDim ( const af_seq seq,
const dim_t parentDim 
)

Returns the number of elements that will be represented by seq if applied on an array.

◆ clamp() [1/4]

AFAPI array af::clamp ( const array in,
const array lo,
const array hi 
)

C++ Interface for clamping an array between two values

Parameters
[in]inInput array
[in]loValue for lower limit
[in]hiValue for upper limit
Returns
array containing values from in clamped between lo and hi
Examples
image_processing/filters.cpp, and image_processing/image_editing.cpp.

◆ clamp() [2/4]

AFAPI array af::clamp ( const array in,
const array lo,
const double  hi 
)

C++ Interface for clamping an array between two values

Parameters
[in]inInput array
[in]loValue for lower limit
[in]hiValue for upper limit
Returns
array containing values from in clamped between lo and hi

◆ clamp() [3/4]

AFAPI array af::clamp ( const array in,
const double  lo,
const array hi 
)

C++ Interface for clamping an array between two values

Parameters
[in]inInput array
[in]loValue for lower limit
[in]hiValue for upper limit
Returns
array containing values from in clamped between lo and hi

◆ clamp() [4/4]

AFAPI array af::clamp ( const array in,
const double  lo,
const double  hi 
)

C++ Interface for clamping an array between two values

Parameters
[in]inInput array
[in]loValue for lower limit
[in]hiValue for upper limit
Returns
array containing values from in clamped between lo and hi

◆ conj() [1/2]

AFAPI cdouble af::conj ( const cdouble val)

◆ conj() [2/2]

AFAPI cfloat af::conj ( const cfloat val)

◆ exampleFunction()

AFAPI array af::exampleFunction ( const array in,
const af_someenum_t  param 
)

◆ filter()

AFAPI array af::filter ( const array image,
const array kernel 
)

Image Filtering.

// filter (convolve) an image with a 3x3 sobel kernel
const float h_kernel[] = { -2.0, -1.0, 0.0,
-1.0, 0.0, 1.0,
0.0, 1.0, 2.0 };
array kernel = array(3,3,h_kernel);
array img_out = filter(img_in, kernel);
Parameters
[in]image
[in]kernelcoefficient matrix
Returns
filtered image (same size as input)
Note
Filtering done using correlation. Array values outside bounds are assumed to have zero value (0).
Deprecated:
Use af::convolve instead
Examples
graphics/gravity_sim.cpp.

◆ getActiveBackend()

AFAPI af::Backend af::getActiveBackend ( )
Returns
af_backend which is the backend is currently active

◆ getRawPtr()

AFAPI void* af::getRawPtr ( const array in)
Parameters
[in]inAn multi dimensional array.
Returns
Returns the raw pointer location to the array.
Note
This pointer may be shared with other arrays. Use this function with caution.

◆ getSizeOf()

AFAPI size_t af::getSizeOf ( af::dtype  type)

Get the size of the type represented by an af_dtype enum.

◆ gforGet()

AFAPI bool af::gforGet ( )

◆ gforSet()

AFAPI void af::gforSet ( bool  val)

◆ gforToggle()

AFAPI bool af::gforToggle ( )

◆ imag() [1/2]

AFAPI double af::imag ( af_cdouble  val)

◆ imag() [2/2]

AFAPI float af::imag ( af_cfloat  val)

◆ isSpan()

AFAPI bool af::isSpan ( const af_seq seq)

Returns true if the af_seq object represents the entire range of an axis.

◆ log2()

AFAPI array af::log2 ( const array in)

C++ Interface for logarithm base 2.

Parameters
[in]inis input
Returns
the logarithm of input in base 2
Examples
machine_learning/geneticalgorithm.cpp.

◆ meanvar()

AFAPI void af::meanvar ( array mean,
array var,
const array in,
const array weights,
const af_var_bias  bias = AF_VARIANCE_POPULATION,
const dim_t  dim = -1 
)

C++ Interface for mean and variance.

Parameters
[out]meanThe mean of the input array along dim dimension
[out]varThe variance of the input array along the dim dimension
[in]inThe input array
[in]weightsThe weights to scale the input array before calculating the mean and varience. If empty, the input is not scaled
[in]biasThe type of bias used for variance calculation
[in]dimThe dimension along which the variance and mean are calculated. Default is -1 meaning the first non-zero dim

◆ operator!=() [1/2]

AFAPI bool af::operator!= ( const cdouble lhs,
const cdouble rhs 
)

◆ operator!=() [2/2]

AFAPI bool af::operator!= ( const cfloat lhs,
const cfloat rhs 
)

◆ operator*() [1/9]

AFAPI af::cdouble af::operator* ( const af::cdouble lhs,
const af::cdouble rhs 
)

◆ operator*() [2/9]

AFAPI af::cdouble af::operator* ( const af::cdouble lhs,
const af::cfloat rhs 
)

◆ operator*() [3/9]

AFAPI af::cdouble af::operator* ( const af::cdouble lhs,
const double &  rhs 
)

◆ operator*() [4/9]

AFAPI af::cdouble af::operator* ( const af::cfloat lhs,
const af::cdouble rhs 
)

◆ operator*() [5/9]

AFAPI af::cfloat af::operator* ( const af::cfloat lhs,
const af::cfloat rhs 
)

◆ operator*() [6/9]

AFAPI af::cfloat af::operator* ( const af::cfloat lhs,
const double &  rhs 
)

◆ operator*() [7/9]

AFAPI dim4 af::operator* ( const dim4 first,
const dim4 second 
)

Performs an element-wise multiplication of two dim4 objects.

◆ operator*() [8/9]

AFAPI af::cdouble af::operator* ( const double &  rhs,
const af::cdouble lhs 
)

◆ operator*() [9/9]

AFAPI af::cfloat af::operator* ( const double &  rhs,
const af::cfloat lhs 
)

◆ operator+() [1/9]

AFAPI af::cdouble af::operator+ ( const af::cdouble lhs,
const af::cdouble rhs 
)

◆ operator+() [2/9]

AFAPI af::cdouble af::operator+ ( const af::cdouble lhs,
const af::cfloat rhs 
)

◆ operator+() [3/9]

AFAPI af::cdouble af::operator+ ( const af::cdouble lhs,
const double &  rhs 
)

◆ operator+() [4/9]

AFAPI af::cdouble af::operator+ ( const af::cfloat lhs,
const af::cdouble rhs 
)

◆ operator+() [5/9]

AFAPI af::cfloat af::operator+ ( const af::cfloat lhs,
const af::cfloat rhs 
)

◆ operator+() [6/9]

AFAPI af::cfloat af::operator+ ( const af::cfloat lhs,
const double &  rhs 
)

◆ operator+() [7/9]

AFAPI dim4 af::operator+ ( const dim4 first,
const dim4 second 
)

Performs an element-wise addition of two dim4 objects.

◆ operator+() [8/9]

AFAPI af::cdouble af::operator+ ( const double &  rhs,
const af::cdouble lhs 
)

◆ operator+() [9/9]

AFAPI af::cfloat af::operator+ ( const double &  rhs,
const af::cfloat lhs 
)

◆ operator-() [1/9]

AFAPI af::cdouble af::operator- ( const af::cdouble lhs,
const af::cdouble rhs 
)

◆ operator-() [2/9]

AFAPI af::cdouble af::operator- ( const af::cdouble lhs,
const af::cfloat rhs 
)

◆ operator-() [3/9]

AFAPI af::cdouble af::operator- ( const af::cdouble lhs,
const double &  rhs 
)

◆ operator-() [4/9]

AFAPI af::cdouble af::operator- ( const af::cfloat lhs,
const af::cdouble rhs 
)

◆ operator-() [5/9]

AFAPI af::cfloat af::operator- ( const af::cfloat lhs,
const af::cfloat rhs 
)

◆ operator-() [6/9]

AFAPI af::cfloat af::operator- ( const af::cfloat lhs,
const double &  rhs 
)

◆ operator-() [7/9]

AFAPI dim4 af::operator- ( const dim4 first,
const dim4 second 
)

Performs an element-wise subtraction of two dim4 objects.

◆ operator-() [8/9]

AFAPI af::cdouble af::operator- ( const double &  rhs,
const af::cdouble lhs 
)

◆ operator-() [9/9]

AFAPI af::cfloat af::operator- ( const double &  rhs,
const af::cfloat lhs 
)

◆ operator/() [1/8]

AFAPI af::cdouble af::operator/ ( const af::cdouble lhs,
const af::cdouble rhs 
)

◆ operator/() [2/8]

AFAPI af::cdouble af::operator/ ( const af::cdouble lhs,
const af::cfloat rhs 
)

◆ operator/() [3/8]

AFAPI af::cdouble af::operator/ ( const af::cdouble lhs,
const double &  rhs 
)

◆ operator/() [4/8]

AFAPI af::cdouble af::operator/ ( const af::cfloat lhs,
const af::cdouble rhs 
)

◆ operator/() [5/8]

AFAPI af::cfloat af::operator/ ( const af::cfloat lhs,
const af::cfloat rhs 
)

◆ operator/() [6/8]

AFAPI af::cfloat af::operator/ ( const af::cfloat lhs,
const double &  rhs 
)

◆ operator/() [7/8]

AFAPI af::cdouble af::operator/ ( const double &  rhs,
const af::cdouble lhs 
)

◆ operator/() [8/8]

AFAPI af::cfloat af::operator/ ( const double &  rhs,
const af::cfloat lhs 
)

◆ operator<<() [1/3]

AFAPI std::ostream& af::operator<< ( std::ostream &  os,
const cdouble in 
)

◆ operator<<() [2/3]

AFAPI std::ostream& af::operator<< ( std::ostream &  os,
const cfloat in 
)

◆ operator<<() [3/3]

static std::ostream& af::operator<< ( std::ostream &  ostr,
const dim4 dims 
)
inlinestatic

Prints the elements of the dim4 array separated by spaces.

Parameters
[in,out]ostrAn ostream object
[in]dimsThe dim4 object to be printed
Returns
the reference to the ostr after the dim4 string as been streamed in

Definition at line 115 of file dim4.hpp.

◆ operator==() [1/2]

AFAPI bool af::operator== ( const cdouble lhs,
const cdouble rhs 
)

◆ operator==() [2/2]

AFAPI bool af::operator== ( const cfloat lhs,
const cfloat rhs 
)

◆ operator>>() [1/3]

AFAPI std::istream& af::operator>> ( std::istream &  is,
cdouble in 
)

◆ operator>>() [2/3]

AFAPI std::istream& af::operator>> ( std::istream &  is,
cfloat in 
)

◆ operator>>() [3/3]

static std::istream& af::operator>> ( std::istream &  istr,
dim4 dims 
)
inlinestatic

Reads 4 dim_t values from an input stream and stores the results in a dim4.

Parameters
[in,out]istrAn istream object
[in]dimsThe dim4 object that will store the values
Returns
The istr object after 4 dim_t values have been read from the input

Definition at line 132 of file dim4.hpp.

◆ real() [1/2]

AFAPI double af::real ( af_cdouble  val)

◆ real() [2/2]

AFAPI float af::real ( af_cfloat  val)

◆ seqElements()

AFAPI size_t af::seqElements ( const af_seq seq)

Returns the number of elements that the af_seq object represents.

◆ setFFTPlanCacheSize()

AFAPI void af::setFFTPlanCacheSize ( size_t  cacheSize)

C++ Interface for setting plan cache size.

This function doesn't do anything if called when CPU backend is active. The plans associated with the most recently used array sizes are cached.

Parameters
[in]cacheSizeis the number of plans that shall be cached

◆ sigmoid()

AFAPI array af::sigmoid ( const array in)

C++ Interface for calculating sigmoid function of an array.

Parameters
[in]inis input
Returns
the sigmoid of in
Examples
machine_learning/deep_belief_net.cpp, machine_learning/logistic_regression.cpp, machine_learning/neural_network.cpp, machine_learning/perceptron.cpp, and machine_learning/rbm.cpp.

◆ timeit()

Variable Documentation

◆ end

AFAPI int end

A special value representing the last value of an axis.

Examples
helloworld/helloworld.cpp.

◆ Inf

AFAPI const double Inf

◆ NaN

AFAPI const double NaN

◆ Pi

◆ span

afcl::array
static af::array array(af::dim4 idims, cl_mem buf, af::dtype type, bool retain=false)
Create an af::array object from an OpenCL cl_mem buffer.
Definition: opencl.h:327
af::filter
AFAPI array filter(const array &image, const array &kernel)
Image Filtering.