GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
randomness.hpp File Reference

Go to the source code of this file.

Classes

class  grem::randomness::SplitMix64Engine
 Implementation of the SplitMix64 pseudorandom number generator that provides the API required for a standard uniform random bit generator, so that it can be plugged into any of the random number distributions provided by the standard library. More...
class  grem::randomness::Xoroshiro128PlusPlusEngine
 Implementation of the xoroshiro128++ pseudorandom number generator that provides the API required for a standard uniform random bit generator, so that it can be plugged into any of the random number distributions provided by the standard library. More...

Namespaces

namespace  grem
namespace  grem::randomness

Typedefs

using grem::randomness::NonDeterministicRandomEngine = std::random_device
 Uniformly-destributed random number generator that provides non-deterministic random numbers if supported by the host system.
using grem::randomness::DefaultRandomEngine = Xoroshiro128PlusPlusEngine
 Default pseudorandom number generator.
template<typename Integer>
using grem::randomness::UniformIntegerDistribution = std::uniform_int_distribution<Integer>
 Random number distribution that produces integer values uniformly distributed on the closed interval [a, b].
template<typename Float>
using grem::randomness::UniformRealDistribution = std::uniform_real_distribution<Float>
 Random number distribution that produces floating-point values uniformly distributed on the half-open interval [a, b).
using grem::randomness::BernoulliDistribution = std::bernoulli_distribution
 Random number distribution that produces boolean values with probability p of being true.
template<typename Integer>
using grem::randomness::BinomialDistribution = std::binomial_distribution<Integer>
 Random number distribution that produces non-negative integer values that correspond to the number of true values in a sequence of t boolean tests, each with probability p of being true.
template<typename Integer>
using grem::randomness::NegativeBinomialDistribution = std::negative_binomial_distribution<Integer>
 Random number distribution that produces non-negative integer values that correspond to the number of false values before exactly k true values occur in a sequence of boolean tests, each with probability p of being true.
template<typename Integer>
using grem::randomness::GeometricDistribution = std::geometric_distribution<Integer>
 Random number distribution that produces non-negative integer values that correspond to the number of false values before a true value occurs in a sequence of boolean tests, each with probability p of being true.
template<typename Integer>
using grem::randomness::PoissonDistribution = std::poisson_distribution<Integer>
 Random number distribution that produces non-negative integer values that correspond to the number of occurences of a random event where the expected average number of occurences is μ in the same interval under the same conditions.
template<typename Float>
using grem::randomness::ExponentialDistribution = std::exponential_distribution<Float>
 Random number distribution that produces non-negative floating-point values that correspond to the time/distance until the next random event if random events occur at a constant average rate λ per unit of time/distance.
template<typename Float>
using grem::randomness::NormalDistribution = std::normal_distribution<Float>
 Random number distribution that produces floating-point values according to a Normal/Gaussian distribution with mean μ and standard deviation σ.
template<typename Integer>
using grem::randomness::DiscreteDistribution = std::discrete_distribution<Integer>
 Random number distribution that, given a list of weights w, produces integer values in the interval [0, w.size() - 1] with each integer i having probability w[i] / sum(w) of being selected.

Functions

template<floating_point T, size_t EntropyBits = std::numeric_limits<T>::digits>
T grem::randomness::generateCanonical (auto &generator)
 Generate a random floating-point number uniformly distributed on the half-open interval [0, 1).