Assign(copy) content of an Array to another Array indexed by Sequences Assign `rhs` to `lhs` after indexing `lhs` # Examples ```rust use arrayfire::{constant, Dim4, Seq, assign_seq, print}; let mut a = constant(2.0 as f32, Dim4::new(&[5, 3, 1, 1])); print(&a); // 2.0 2.0 2.0 // 2.0 2.0 2.0 // 2.0 2.0 2.0 // 2.0 2.0 2.0 // 2.0 2.0 2.0 let b = constant(1.0 as f32, Dim4::new(&[3, 3, 1, 1])); l
(lhs: &mut Array<I>, seqs: &[Seq<T>], rhs: &Array<I>)
| 510 | /// // 2.0 2.0 2.0 |
| 511 | /// ``` |
| 512 | pub fn assign_seq<T, I>(lhs: &mut Array<I>, seqs: &[Seq<T>], rhs: &Array<I>) |
| 513 | where |
| 514 | c_double: From<T>, |
| 515 | I: HasAfEnum, |
| 516 | T: Copy + IndexableType, |
| 517 | { |
| 518 | let seqs: Vec<SeqInternal> = seqs.iter().map(|s| SeqInternal::from_seq(s)).collect(); |
| 519 | unsafe { |
| 520 | let mut temp: af_array = std::ptr::null_mut(); |
| 521 | let err_val = af_assign_seq( |
| 522 | &mut temp as *mut af_array, |
| 523 | lhs.get() as af_array, |
| 524 | seqs.len() as c_uint, |
| 525 | seqs.as_ptr() as *const SeqInternal, |
| 526 | rhs.get() as af_array, |
| 527 | ); |
| 528 | HANDLE_ERROR(AfError::from(err_val)); |
| 529 | |
| 530 | let modified = temp.into(); |
| 531 | let _old_arr = mem::replace(lhs, modified); |
| 532 | } |
| 533 | } |
| 534 | |
| 535 | /// Index an Array using any combination of Array's and Sequence's |
| 536 | /// |