Skip to main content

weighted_sample

Function weighted_sample 

Source
pub fn weighted_sample(weights: &[f64], rng: &mut impl Rng) -> usize
Expand description

Weighted sampling — draw one index proportional to weights.