forked from arrayfire/arrayfire
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.dox
More file actions
51 lines (26 loc) · 1.32 KB
/
Copy pathindex.dox
File metadata and controls
51 lines (26 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
\addtogroup arrayfire_func
@{
\defgroup index_func_index index
\ingroup index_mat
\brief Lookup values of an array based on sequences and/or arrays
\defgroup index_func_lookup Lookup
\ingroup index_mat
\brief Lookup values of an array by indexing with another array.
Will return an array with the values in the \p in array from the locations specified in the \p idx array.
The resulting array contains values corresponding to each of the provided indices.
Locations of the input data are assumed to be in the range [0, n). Indexing outside of this range will result in mirrored wrap-around behavior.
A simple example of one-dimension indexing can be seen in the following example.
\snippet test/index.cpp ex_index_lookup1d
Index locations can also be out of bounds.
\snippet test/index.cpp ex_index_lookup_oob
The dimensiong along which to query the indices can also be specified. The resulting array will be of the same size as the input, except for the queried dimension which will match the number of elements in the index array.
\snippet test/index.cpp ex_index_lookup2d
\defgroup index_func_assign assign
\ingroup index_mat
\brief Copy and write values in the locations specified by the sequences
\defgroup index_func_util util
\ingroup index_mat
\brief Utility functions to create objects of type \ref af_index_t
@}
*/