Index an Array using any combination of Array's and Sequence's # Examples ```rust use arrayfire::{Array, Dim4, Seq, print, randu, index_gen, Indexer}; let values: [f32; 3] = [1.0, 2.0, 3.0]; let indices = Array::new(&values, Dim4::new(&[3, 1, 1, 1])); let seq4gen = Seq::new(0.0, 2.0, 1.0); let a = randu:: (Dim4::new(&[5, 3, 1, 1])); // [5 3 1 1] // 0.0000 0.2190 0.3835 // 0.1
(input: &Array<T>, indices: Indexer)
| 562 | /// // 0.4587 0.6793 0.0346 |
| 563 | /// ``` |
| 564 | pub fn index_gen<T>(input: &Array<T>, indices: Indexer) -> Array<T> |
| 565 | where |
| 566 | T: HasAfEnum, |
| 567 | { |
| 568 | unsafe { |
| 569 | let mut temp: af_array = std::ptr::null_mut(); |
| 570 | let err_val = af_index_gen( |
| 571 | &mut temp as *mut af_array, |
| 572 | input.get() as af_array, |
| 573 | indices.len() as dim_t, |
| 574 | indices.get() as af_index_t, |
| 575 | ); |
| 576 | HANDLE_ERROR(AfError::from(err_val)); |
| 577 | temp.into() |
| 578 | } |
| 579 | } |
| 580 | |
| 581 | /// Assign an Array to another after indexing it using any combination of Array's and Sequence's |
| 582 | /// |