Module rand_distr::weighted_alias[][src]

Expand description

This module contains an implementation of alias method for sampling random indices with probabilities proportional to a collection of weights.

Structs

WeightedAliasIndex

A distribution using weighted sampling to pick a discretely selected item.

Traits

AliasableWeight

Trait that must be implemented for weights, that are used with WeightedAliasIndex. Currently no guarantees on the correctness of WeightedAliasIndex are given for custom implementations of this trait.