MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / indexBySeqs

Function indexBySeqs

src/api/c/index.cpp:72–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70
71template<typename T>
72static af_array indexBySeqs(const af_array& src,
73 const vector<af_seq>& indicesV) {
74 auto ndims = static_cast<dim_t>(indicesV.size());
75 const auto& input = getArray<T>(src);
76
77 if (ndims == 1U && ndims != input.ndims()) {
78 return getHandle(createSubArray(flat(input), indicesV));
79 } else {
80 return getHandle(createSubArray(input, indicesV));
81 }
82}
83
84af_err af_index(af_array* result, const af_array in, const unsigned ndims,
85 const af_seq* indices) {

Callers

nothing calls this directly

Calls 4

getHandleFunction · 0.70
createSubArrayFunction · 0.50
flatFunction · 0.50
ndimsMethod · 0.45

Tested by

no test coverage detected