AFArray class

-> ArrayFire Documentation

TOC

Staitc methods

AFArray.create()

asynchronous, counterparts: createAsync, createSync

Creates an AFArray instance of the specified dimensions, and copies data from the location specified by the buffer. Data can be reside on the host or on the device, the source argument specifies its location.

Arguments:

Result: the created AFArray instance.

constructor

Arrays could be created as empty ones or by having a specified dimensions and element type.

Arguments:

Remarks:

In Fire.js type argument is not optional.

Methods

elements()

Get the number of elements in array.

Result: Number

host()

Copy array data to host.

asynchronous, counterparts: hostAsync, hostSync

Arguments:

Result: if buffer is not specified, then it will be created and returned, otherwise the result is undefined

copyToHost()

alias of host

scalar()

asynchronous, counterparts: scalarAsync, scalarSync

Get scalar value from the array (if its size is larger than one in any dimensions it gives the first value).

Result: Boolean|Number|String|Complex value in the array, type depends on the array's type.

value()

alias of scalar()

write()

Perform deep copy from host/device pointer to an existing array.

Arguments:

type()

Result: array's element type, can be one of the values of dType object

dims()

Result: - of dims(): array's dimensions info in a Dim4 object instance - of dims(n): size of the specified dimension

numdims()

Result: number of dimensions of the array

numDims()

alias of numdims

bytes()

Result: size of the array in bytes

as()

Converts the array into another type.

Arguments:

Result: AFArray instance holding reference the converted array

copy())`

Result: new AFArray instance holding a deep copy of the array

isempty(), isscalar(), isvector(), isrow(), iscolumn(), iscomplex(), isreal(), isdouble(), issingle(), isrealfloating(), isfloating(), isinteger(), isbool()

aliases respectively: isEmpty, isScalar, isVector, isRow, isColumn, isComplex, isReal, isDouble, isSingle, isRealFloating, isFloating, isInteger, isBool

Result: actual type info (Boolean)

eval()

Evaluate any JIT expressions to generate data for the array.

Indexing Operations

at()

-> ArrayFire Documentation

Arguments:

Result: AFArray instance holding reference to the the specified region of the original array

row(), rows()

Gets a reference of a row in a 2D AFArray.

-> ArrayFire Documentation

Arguments:

Result: AFArray instance holding reference to the specified region of the original 2D array

col(), cols()

Gets a reference of a column in a 2D AFArray.

-> ArrayFire Documentation

Arguments:

Result: AFArray instance holding reference to the specified region of the original 2D array

slice(), slices()

Gets a reference of a matrix in a 3D AFArray.

-> ArrayFire Documentation

Arguments:

Result: AFArray instance holding reference to the specified region of the original 3D array

Assignment Operators

-> ArrayFire Documentation

Arguments:

Result: assignee AFArray instance

Arithmetic Operators

-> ArrayFire Documentation

Arguments:

Result: AFArray instance holding the operation's result

Logical Operators

-> ArrayFire Documentation

Arguments:

Result: AFArray instance holding the operation's result