MCPcopy Index your code
hub / github.com/arrayfire/arrayfire-rust / lookup

Function lookup

src/core/index.rs:467–483  ·  view source on GitHub ↗

Lookup(hash) an Array using another Array Given a dimension `seq_dim`, `indices` are lookedup in `input` and returned as a new Array if found

(input: &Array<T>, indices: &Array<I>, seq_dim: i32)

Source from the content-addressed store, hash-verified

465/// Given a dimension `seq_dim`, `indices` are lookedup in `input` and returned as a new
466/// Array if found
467pub fn lookup<T, I>(input: &Array<T>, indices: &Array<I>, seq_dim: i32) -> Array<T>
468where
469 T: HasAfEnum,
470 I: HasAfEnum + IndexableType,
471{
472 unsafe {
473 let mut temp: af_array = std::ptr::null_mut();
474 let err_val = af_lookup(
475 &mut temp as *mut af_array,
476 input.get() as af_array,
477 indices.get() as af_array,
478 seq_dim as c_uint,
479 );
480 HANDLE_ERROR(AfError::from(err_val));
481 temp.into()
482 }
483}
484
485/// Assign(copy) content of an Array to another Array indexed by Sequences
486///

Callers

nothing calls this directly

Calls 3

HANDLE_ERRORFunction · 0.85
intoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected