2 #ifndef _RandomGenerator_h
3 #define _RandomGenerator_h
42 static Eigen::MatrixXd
GetNormal(
int rows,
int cols);
47 static Eigen::MatrixXd
GetUniform(
int rows,
int cols);
49 static double GetGamma(
double const alpha,
double const beta);
50 static Eigen::MatrixXd
GetGamma(
double const alpha,
double const beta,
int rows){
return GetGamma(alpha, beta, rows, 1);};
51 static Eigen::MatrixXd
GetGamma(
double const alpha,
double const beta,
int rows,
int cols);
58 static Eigen::MatrixXi
GetUniformInt(
int lb,
int ub,
int rows,
int cols,
bool unique);
62 static int GetDiscrete(std::vector<double>
const& discProbs);
63 static int GetDiscrete(Eigen::Ref<const Eigen::VectorXd>
const& discProbs);
65 static Eigen::MatrixXi
GetDiscrete(std::vector<double>
const& discProbs,
int rows,
int cols=1);
66 static Eigen::MatrixXi
GetDiscrete(Eigen::Ref<const Eigen::VectorXd>
const& discProbs,
int rows,
int cols=1);
69 static void SetSeed(
int seedval);
88 SeedGenerator(
const std::array<std::seed_seq::result_type, RandomGenerator::GeneratorType::state_size> &seed_data);
RandomGeneratorTemporarySetSeed(int seed)
virtual ~RandomGeneratorTemporarySetSeed()
std::mt19937 oldGenerator
static Eigen::MatrixXd GetUniform(int rows)
static int GetDiscrete(std::vector< double > const &discProbs)
static Eigen::MatrixXi GetUniformInt(int lb, int ub, int rows, bool unique)
static Eigen::MatrixXi GetUniformInt(int lb, int ub, int rows, int cols)
static Eigen::MatrixXd GetNormal(int rows)
static void SetGenerator(GeneratorType)
Set the state of the generator, designed for use with CopyGenerator. Be very careful in using this,...
std::mt19937 GeneratorType
static GeneratorType & GetGenerator()
static double GetNormal()
static GeneratorType CopyGenerator()
Store a copy of the generator, designed for use with SetGenerator. Be very careful in using this,...
static void SetSeed(int seedval)
Set the seed for the random number generator. This is a fairly low quality way to do this,...
static double GetGamma(double const alpha, double const beta)
static double GetUniform()
friend RandomGeneratorTemporarySetSeed
static int GetUniformInt(int lb, int ub)
static Eigen::MatrixXd GetGamma(double const alpha, double const beta, int rows)
static Eigen::MatrixXi GetUniformInt(int lb, int ub, int rows)
SeedGenerator(const std::array< std::seed_seq::result_type, RandomGenerator::GeneratorType::state_size > &seed_data)