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 );
149 inline bool empty()
const {
return m_values.empty(); }
155 inline unsigned int left()
const {
return m_values.size(); }
Functions to generate pseudo-random numbers.
static void SeedRandOnce()
static T RandomValue(T min, T max)
static bool m_already_seeded
If SeedRandOnce() or SeedRandOnce(int) have already been called.
int m_max
Max of range of values.
static T RandomGaussianValue(T mean, T sigma)
static int RandomInt(int min, int max)
TFSIMD_FORCE_INLINE const tfScalar & w() const
Provides pseudo-random numbers with no repetitions.
unsigned int left() const
int m_min
Min of range of values.
std::vector< int > m_values
Available values.