ArrayFire: operator() (original) (raw)

Gets a reference to a set of elements. More...

Functions
array::array_proxy operator() (const index &s0)
This operator returns a reference of the original array at a given coordinate. More...
const array::array_proxy operator() (const index &s0) const
This operator returns a reference of the original array at a given coordinate. More...
array::array_proxy operator() (const index &s0, const index &s1, const index &s2=span, const index &s3=span)
This operator returns a reference of the original array at a given coordinate. More...
const array::array_proxy operator() (const index &s0, const index &s1, const index &s2=span, const index &s3=span) const
This operator returns a reference of the original array at a given coordinate. More...

Gets a reference to a set of elements.

array A = array(seq(1, 9), 3, 3);

af_print(A(0, 1));

af_print(A(end));

af_print(A(-1));

af_print(A(end - 1));

af_print(A(1, span));

af_print(A.row(end));

af_print(A.cols(1, end));

float b_host[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

array b(10, 1, b_host);

This operator returns a reference of the original array at a given coordinate. You can pass af::seq, af::array, or an int as it's parameters. These references can be used for assignment or returning references to af::array objects.


operator()() [1/4]

This operator returns a reference of the original array at a given coordinate.

You can pass af::seq, af::array, or an int as its parameters. These references can be used for assignment or returning references to af::array objects.

If the af::array is a multi-dimensional array then this coordinate will treated as the data as a linear array.

Parameters

[in] s0 is sequence of linear indices

Returns

A reference to the array at the given index

operator()() [2/4]

This operator returns a reference of the original array at a given coordinate.

You can pass af::seq, af::array, or an int as its parameters. These references can be used for assignment or returning references to af::array objects.

If the af::array is a multi-dimensional array then this coordinate will treated as the data as a linear array.

Parameters

[in] s0 is sequence of linear indices

Returns

A reference to the array at the given index

operator()() [3/4]

This operator returns a reference of the original array at a given coordinate.

You can pass af::seq, af::array, or an int as it's parameters. These references can be used for assignment or returning references to af::array objects.

Parameters

[in] s0 is sequence of indices along the first dimension
[in] s1 is sequence of indices along the second dimension
[in] s2 is sequence of indices along the third dimension
[in] s3 is sequence of indices along the fourth dimension

Returns

A reference to the array at the given index

operator()() [4/4]

This operator returns a reference of the original array at a given coordinate.

You can pass af::seq, af::array, or an int as it's parameters. These references can be used for assignment or returning references to af::array objects.

Parameters

[in] s0 is sequence of indices along the first dimension
[in] s1 is sequence of indices along the second dimension
[in] s2 is sequence of indices along the third dimension
[in] s3 is sequence of indices along the fourth dimension

Returns

A reference to the array at the given index