Module genevo::random [] [src]

The random module defines functions that are used to generate random values for specific purposes.

Structs

Closed01

A wrapper for generating floating point numbers uniformly in the closed interval [0,1] (including both endpoints).

WeightedDistribution

The WeightedDistribution is used to select values proportional to their weighted values.

Traits

Rng

A random number generator.

RngJump

A random number generator with jumpable state.

SampleRange

The helper trait for types that have a sensible way to sample uniformly between two values. This should not be used directly, and is only to facilitate Range.

SeedableRng

A random number generator that can be explicitly seeded to produce the same stream of randomness multiple times.

Functions

get_rng

Returns a new Prng initialized with the given seed.

random_cut_points

Generates two cut points for a slice of given length using the given Prng. The first of the two returned cut points is always smaller than the second one.

random_cut_points_from_range

Generates two cut points within the given range using the given Prng. The first of the two returned cut points is always smaller than the second one.

random_index

Generates a random index into a slice of given length using the given Prng.

random_index_from_range

Generates a random index in the given range using the given Prng.

random_n_cut_points

Generates n cut points for a slice of given length using the given Prng. The returned cut points are ordered in ascending order.

random_probability

Generates a random probability between 0 and 1 using the given Prng.

random_seed

Generates a random seed to initialize the Prng.

Type Definitions

Prng

The Prng is the pseudo random number generator used through out this library.

Seed

The Seed as used through out this library to seed the Prng.