Function lattice_qcd_rs::statistics::mean
source · pub fn mean<'a, T, IntoIter>(data: IntoIter) -> Twhere
T: Div<f64, Output = T> + Sum<&'a T> + 'a,
IntoIter: IntoIterator<Item = &'a T>,
IntoIter::IntoIter: ExactSizeIterator,
Expand description
compute the mean from a collections
Example
use lattice_qcd_rs::statistics::mean;
use nalgebra::Complex;
mean(&[1_f64, 2_f64, 3_f64, 4_f64]);
let vec = vec![1_f64, 2_f64, 3_f64, 4_f64];
mean(&vec);
let vec_complex = vec![Complex::new(1_f64, 2_f64), Complex::new(-7_f64, -9_f64)];
mean(&vec_complex);