[][src]Function rulinalg::utils::vec_sum

pub fn vec_sum<T: Copy + Add<T, Output = T>>(u: &[T], v: &[T]) -> Vec<T>

Compute vector sum of two slices.

Examples

use rulinalg::utils;
let a = vec![1.0, 2.0, 3.0, 4.0];
let b = vec![1.0, 2.0, 3.0, 4.0];

let c = utils::vec_sum(&a,&b);

assert_eq!(c, vec![2.0, 4.0, 6.0, 8.0]);