Skip to main content

weighted_sample_with_replacement

Function weighted_sample_with_replacement 

Source
fn weighted_sample_with_replacement(
    population: &[i64],
    weights: &[f64],
    size: usize,
    rng: &mut impl Rng,
) -> Vec<Option<i64>>
Expand description

Weighted sampling with replacement using cumulative probability + binary search.