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

Function assign_seq

src/core/index.rs:512–533  ·  view source on GitHub ↗

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>)

Source from the content-addressed store, hash-verified

510/// // 2.0 2.0 2.0
511/// ```
512pub fn assign_seq<T, I>(lhs: &mut Array<I>, seqs: &[Seq<T>], rhs: &Array<I>)
513where
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///

Callers 8

set_rowFunction · 0.85
set_rowsFunction · 0.85
set_colFunction · 0.85
set_colsFunction · 0.85
set_sliceFunction · 0.85
set_slicesFunction · 0.85
non_macro_seq_assignFunction · 0.85
acoustic_wave_simulationFunction · 0.85

Calls 5

HANDLE_ERRORFunction · 0.85
replaceFunction · 0.85
lenMethod · 0.80
intoMethod · 0.80
getMethod · 0.45

Tested by 1

non_macro_seq_assignFunction · 0.68