Function lattice_qcd_rs::statistics::variance_par_iter
source · pub fn variance_par_iter<'a, It, T>(data: It) -> Twhere
T: Clone + Div<f64, Output = T> + Sum<T> + Sum<It::Item> + Send + Sync + 'a + Sub<T, Output = T> + Mul<T, Output = T> + Zero,
It: IndexedParallelIterator<Item = &'a T> + Clone,
Expand description
Compute the variance (squared of standard deviation) from
a [rayon::iter::IndexedParallelIterator
].
The alternative for iterator that yield non reference is variance_par_iter_val
.
Example
use lattice_qcd_rs::statistics::variance_par_iter;
use rayon::prelude::*;
let vec = vec![1_f64, 2_f64, 3_f64, 4_f64 /* ... */];
let variance = variance_par_iter(vec.par_iter());