pub struct Sum<'a> { /* private fields */ }
Expand description
Computes the sum of a sequence of numbers.
This is more efficient than slice.iter().sum()
as it computes multiple
partial sums in parallel using SIMD and then sums across the SIMD lanes at
the end. This will produce very slightly different results because the
additions are happening in a different order.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Sum<'a>
impl<'a> RefUnwindSafe for Sum<'a>
impl<'a> Send for Sum<'a>
impl<'a> Sync for Sum<'a>
impl<'a> Unpin for Sum<'a>
impl<'a> UnwindSafe for Sum<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more