35 std::random_device rd;
53 std::random_device rd;
57 return std::default_random_engine(seed);
69 return std * sample + mean;
81 return min + sample * (max - min);
114 void init(
double arg1,
double arg2,
int seed = -1) {
Templated probability distribution.
T d_dist
Templated distribution.
DistributionSample()
Constructor.
DistributionSample(double arg1, double arg2, int seed=-1)
Constructor.
RandGenerator d_gen
Random number generator.
void init(double arg1, double arg2, int seed=-1)
Initialize the distribution.
double operator()()
Sample from the distribution.
Collection of methods useful in simulation.
double transform_to_uniform_dist(double min, double max, double sample)
Transform sample from U(0,1) to U(a,b)
std::default_random_engine get_rd_engine(int &seed)
Return random number generator.
double transform_to_normal_dist(double mean, double std, double sample)
Transform sample from N(0,1) to N(mean, std^2)
RandGenerator get_rd_gen(int seed=-1)
Return random number generator.
std::lognormal_distribution LogNormalDistribution
std::uniform_real_distribution UniformDistribution
std::normal_distribution NormalDistribution
std::mt19937 RandGenerator
std::uniform_int_distribution UniformIntDistribution