47 #ifndef _MIRA_RANDOM_H_ 48 #define _MIRA_RANDOM_H_ 55 #define MIRA_RANDOM mira::RandomGeneratorSingleton::instance() 124 return min + (T)(
random()*(max-min));
134 assert(sigma >= 0.0);
145 }
while ((r2 > 1.0) || (r2 == 0));
148 return sigma * y * sqrt(-2.0*log(r2)/r2);
Singleton class for generating random numbers.
Definition: Random.h:81
double random()
Platform independent generation of random, double precision floating point random numbers in the inte...
Definition: Random.h:112
Implementation of the CreationPolicy that is used by the Singleton template.
Definition: Singleton.h:149
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
Time and Duration wrapper class.
double gaussian(double sigma=1.0)
deprecated, use normal() instead.
Definition: Random.h:152
Provided for convenience.
Definition: Singleton.h:528
T uniform(T min, T max)
Generate uniform distributed random numbers in the interval [min, max)
Definition: Random.h:122
A singleton class that can be freely configured using policies that control the creation, instantiation, lifetime and thread-safety.
static Time now()
Returns the current utc based time.
Definition: Time.h:481
void seed(uint64 seed=0)
Seed the random number generator.
Definition: Random.h:100
double normal(double sigma=1.0)
Generate standard normally distributed random numbers using a source of uniformly distributed random ...
Definition: Random.h:132