57 return (T)rand()/(T)RAND_MAX;
68 return Random::RandomValue<T>() * (max - min) + min;
91 x1 = (T)2. * RandomValue<T>() - (T)1.;
92 x2 = (T)2. * RandomValue<T>() - (T)1.;
93 w = x1 * x1 + x2 * x2;
94 }
while ( w >= (T)1. || w == (T)0. );
96 w = sqrt( ((T)-2.0 * log( w ) ) / w );
99 return( mean + y1 * sigma );
105 static bool m_already_seeded;
Provides pseudo-random numbers with no repetitions.
UnrepeatedRandomizer & operator=(const UnrepeatedRandomizer &rnd)
int m_max
Max of range of values.
int m_min
Min of range of values.
unsigned int left() const
std::vector< int > m_values
Available values.
Functions to generate pseudo-random numbers.
static T RandomValue(T min, T max)
static void SeedRandOnce()
static T RandomGaussianValue(T mean, T sigma)
static int RandomInt(int min, int max)