Lines Matching refs:distr
124 let distr = X::Sampler::new(zero, total_weight.clone()); in new() localVariable
129 weight_distribution: distr, in new()
308 let distr = WeightedIndex::new(weights.to_vec()).unwrap(); in test_weightedindex() localVariable
310 chosen[distr.sample(&mut r)] += 1; in test_weightedindex()
316 let distr = WeightedIndex::new(&weights[..]).unwrap(); in test_weightedindex() localVariable
318 chosen[distr.sample(&mut r)] += 1; in test_weightedindex()
324 let distr = WeightedIndex::new(weights.iter()).unwrap(); in test_weightedindex() localVariable
326 chosen[distr.sample(&mut r)] += 1; in test_weightedindex()
380 let mut distr = WeightedIndex::new(weights.to_vec()).unwrap(); in test_update_weights() localVariable
381 assert_eq!(distr.total_weight, total_weight); in test_update_weights()
383 distr.update_weights(update).unwrap(); in test_update_weights()
386 assert_eq!(distr.total_weight, expected_total_weight); in test_update_weights()
387 assert_eq!(distr.total_weight, expected_distr.total_weight); in test_update_weights()
388 assert_eq!(distr.cumulative_weights, expected_distr.cumulative_weights); in test_update_weights()
402 let distr = WeightedIndex::new(weights).unwrap(); in value_stability() localVariable
405 *r = rng.sample(&distr); in value_stability()