Function rulinalg::utils::in_place_vec_bin_op
source · [−]Expand description
Vectorized binary operation applied to two slices. The first argument should be a mutable slice which will be modified in place to prevent new memory allocation.
Examples
use rulinalg::utils;
let mut a = vec![2.0; 10];
let b = vec![3.0; 10];
utils::in_place_vec_bin_op(&mut a, &b, |x, &y| { *x = 1f64 + *x * y });
// Will print a vector of `7`s.
println!("{:?}", a);