Merged
Merged
Conversation
|
|
||
| af::array indexed = af::lookup(in, idx); | ||
| af_print(indexed); | ||
| // indexed == { 20, 40, 30 }; |
|
|
||
| // indexes can be out of bounds | ||
| // indexing past end of array | ||
| int idx_outofbounds_p_[8] = {4, 5, 6, 7, 8, 9, 10, 11}; |
| // indexed_out_of_bounds_pos = { 50, 50, 40, 30, 20, 10, 50, 40 } | ||
| af_print(indexed_out_of_bounds_pos); | ||
| // indexed_out_of_bounds_neg = { 10, 10, 20, 30, 40, 50, 10, 20 } | ||
| af_print(indexed_out_of_bounds_neg); |
| \endcode | ||
| \brief Lookup values of an array by indexing with another array. | ||
|
|
||
| \ref af::lookup will look up the values of an array accoring to specified indices inside of an index array. |
Labels
None yet