Skip to main content

numeric_samples

Function numeric_samples 

Source
pub fn numeric_samples(samples: &mut [Vec<f64>])
Expand description

Put a set of numeric samples in ascending order, in place: value by value in numeric’s order, and a sample that is a prefix of another before it. Once each sample is itself in numeric order, this is what makes a computation that draws among the samples independent of the order they were listed in.

use majordomus_cli::order::numeric_samples;

let mut samples = vec![vec![0.3, 0.4], vec![0.1], vec![0.3]];
numeric_samples(&mut samples);
assert_eq!(samples, [vec![0.1], vec![0.3], vec![0.3, 0.4]]);