SG++-Doxygen-Documentation
|
Singleton class for generating pseudo-random numbers (wrapper around std::mt19937 from <random>). More...
#include <RandomNumberGenerator.hpp>
Public Types | |
typedef std::mt19937::result_type | SeedType |
type of the seed More... | |
Public Member Functions | |
double | getGaussianRN (double mean=0.0, double stdDev=1.0) |
Generate a Gaussian pseudo-random number. More... | |
void | getGaussianRV (base::DataVector &vector, double mean=0.0, double stdDev=1.0) |
Fills vector with Gaussian pseudo-random numbers. More... | |
SeedType | getSeed () const |
size_t | getUniformIndexRN (size_t size) |
Generate a uniform pseudo-random array index. More... | |
double | getUniformRN (double a=0.0, double b=1.0) |
Generate a uniform pseudo-random number. More... | |
void | getUniformRV (base::DataVector &vector, double a=0.0, double b=1.0) |
Fills vector with uniform pseudo-random numbers. More... | |
void | setSeed () |
Reseeds with time-dependent seed. More... | |
void | setSeed (SeedType seed) |
Reseeds. More... | |
Static Public Member Functions | |
static RandomNumberGenerator & | getInstance () |
Protected Attributes | |
std::mt19937 | generator |
random number generator More... | |
SeedType | seed |
seed More... | |
Singleton class for generating pseudo-random numbers (wrapper around std::mt19937 from <random>).
typedef std::mt19937::result_type sgpp::optimization::RandomNumberGenerator::SeedType |
type of the seed
double sgpp::optimization::RandomNumberGenerator::getGaussianRN | ( | double | mean = 0.0 , |
double | stdDev = 1.0 |
||
) |
Generate a Gaussian pseudo-random number.
mean | mean of the Gaussian distribution |
stdDev | standard deviation of the Gaussian distribution |
References generator.
Referenced by sgpp::optimization::test_problems::UnconstrainedTestProblem::generateDisplacement(), sgpp::optimization::test_problems::ConstrainedTestProblem::generateDisplacement(), getGaussianRV(), and sgpp::optimization::optimizer::CMAES::optimize().
void sgpp::optimization::RandomNumberGenerator::getGaussianRV | ( | base::DataVector & | vector, |
double | mean = 0.0 , |
||
double | stdDev = 1.0 |
||
) |
Fills vector with Gaussian pseudo-random numbers.
[out] | vector | vector to be filled, has to have desired size beforehand |
mean | mean of the Gaussian distribution | |
stdDev | standard deviation of the Gaussian distribution |
References getGaussianRN(), sgpp::base::DataVector::getSize(), and python.statsfileInfo::i.
|
static |
Referenced by sgpp::optimization::test_problems::UnconstrainedTestProblem::generateDisplacement(), sgpp::optimization::test_problems::ConstrainedTestProblem::generateDisplacement(), sgpp::optimization::optimizer::CMAES::optimize(), sgpp::optimization::optimizer::DifferentialEvolution::optimize(), and sgpp::optimization::optimizer::MultiStart::optimize().
RandomNumberGenerator::SeedType sgpp::optimization::RandomNumberGenerator::getSeed | ( | ) | const |
References seed.
size_t sgpp::optimization::RandomNumberGenerator::getUniformIndexRN | ( | size_t | size | ) |
Generate a uniform pseudo-random array index.
size | size of the array |
References generator.
Referenced by sgpp::optimization::optimizer::DifferentialEvolution::optimize().
double sgpp::optimization::RandomNumberGenerator::getUniformRN | ( | double | a = 0.0 , |
double | b = 1.0 |
||
) |
Generate a uniform pseudo-random number.
a | lower bound |
b | upper bound |
References generator.
Referenced by getUniformRV(), sgpp::optimization::optimizer::DifferentialEvolution::optimize(), and sgpp::optimization::optimizer::MultiStart::optimize().
void sgpp::optimization::RandomNumberGenerator::getUniformRV | ( | base::DataVector & | vector, |
double | a = 0.0 , |
||
double | b = 1.0 |
||
) |
Fills vector with uniform pseudo-random numbers.
[out] | vector | vector to be filled, has to have desired size beforehand |
a | lower bound | |
b | upper bound |
References sgpp::base::DataVector::getSize(), getUniformRN(), and python.statsfileInfo::i.
void sgpp::optimization::RandomNumberGenerator::setSeed | ( | ) |
Reseeds with time-dependent seed.
void sgpp::optimization::RandomNumberGenerator::setSeed | ( | RandomNumberGenerator::SeedType | seed | ) |
|
protected |
random number generator
Referenced by getGaussianRN(), getUniformIndexRN(), getUniformRN(), and setSeed().
|
protected |