Module random

Module random 

Source

Macros§

define_rng
Use this to define a unique type which will be used as a key to retrieve an independent rng instance when calling Context::get_rng.

Traits§

ContextRandomExt
RngId

Functions§

sample_multiple_from_known_length
Samples requested elements uniformly at random without replacement from an iterator whose length is known at runtime. Requires len >= requested.
sample_multiple_l_reservoir
Sample multiple random elements uniformly without replacement from a container of unknown length. If more samples are requested than are in the set, the function returns as many items as it can.
sample_single_from_known_length
Samples one element uniformly at random from an iterator whose length is known at runtime.
sample_single_l_reservoir
Sample a random element uniformly from an iterator of unknown length.