use allocator::Allocator; use {DefaultAllocator, Dim, VectorN}; pub fn cumsum(a: &mut VectorN, b: &mut VectorN) -> usize where DefaultAllocator: Allocator { assert!(a.len() == b.len()); let mut sum = 0; for i in 0..a.len() { b[i] = sum; sum += a[i]; a[i] = b[i]; } sum }