Sample `count` indices with replacement (same index can appear multiple times).
(&self, rng: &mut SeedableRng, count: usize)
| 135 | |
| 136 | /// Sample `count` indices with replacement (same index can appear multiple times). |
| 137 | pub fn sample_with_replacement(&self, rng: &mut SeedableRng, count: usize) -> Vec<usize> { |
| 138 | (0..count).map(|_| self.sample(rng)).collect() |
| 139 | } |
| 140 | |
| 141 | /// Number of items in the distribution. |
| 142 | pub fn len(&self) -> usize { |