Autopysta
Loading...
Searching...
No Matches
random_generator.h
Go to the documentation of this file.
1
12#ifndef _RANDOM_GENERATOR
13#define _RANDOM_GENERATOR
14
15#include <random>
16#include <cmath>
17#include <ctime>
18
27 static std::mt19937_64 generator;
28 static std::normal_distribution<double> distn;
29 static std::uniform_real_distribution<double> distu;
30
31public:
38 static void init();
39
49 static double uniform(double a, double b);
50
58 static double uniform01();
59
70 static double logistic(double mu, double s);
71
81 static double normal(double mu, double sigma);
82};
83
84#endif // _RANDOM_GENERATOR
Utility class for generating random numbers.
Definition random_generator.h:26
static double normal(double mu, double sigma)
Generate a random value from a normal (Gaussian) distribution.
static double uniform01()
Generate a random value from a standard uniform distribution [0, 1].
static double uniform(double a, double b)
Generate a random value from a uniform distribution [a, b].
static double logistic(double mu, double s)
Generate a random value from a logistic distribution.
static void init()
Initialize the random number generator with a seed.