Rosetta 3.3
|
Random number generator system. More...
#include <random.hh>
Public Member Functions | |
RandomGenerator (int const magicNumber) | |
~RandomGenerator () | |
double | uniform () |
double | gaussian () |
Get Gaussian distribution random number. | |
int | random_range (int low, int high) |
Returns a random int in the range specified by the arguments. | |
void | saveState (std::ostream &out) |
void | restoreState (std::istream &in) |
Static Public Member Functions | |
static void | initializeRandomGenerators (int const start_seed, RND_RunType run_type, std::string const &type="") |
static void | saveAllStates (std::ostream &out) |
Saves the state of all random number generators to given stream. | |
static void | restoreAllStates (std::istream &in) |
Restores the state of all random number generators from given stream. |
Random number generator system.
numeric::random::RandomGenerator::RandomGenerator | ( | int const | magicNumber | ) |
References utility::io::oc::cerr, color_pdb::i, and utility_exit.
numeric::random::RandomGenerator::~RandomGenerator | ( | ) |
References begin, and color_pdb::i.
double numeric::random::RandomGenerator::gaussian | ( | ) |
Get Gaussian distribution random number.
SL: this is function is ported from old Rosetta++.
Returns a gaussian random number (normally distributed deviate with zero mean and unit variance) using ran3 as a source of uniform deviates. Always call with the same idum
References PyRosetta-PyMol::log, and uniform().
Referenced by numeric::random::gaussian().
void numeric::random::RandomGenerator::initializeRandomGenerators | ( | int const | start_seed, |
RND_RunType | run_type, | ||
std::string const & | type = "" |
||
) | [static] |
init all rundom number generators in program, must be called after main() start executing
References numeric::random::_RND_TestRun_, numeric::random::createRG(), color_pdb::i, numeric::random::RG, and basic::options::OptionKeys::run::seed_offset.
Referenced by Benchmark::execute().
Returns a random int in the range specified by the arguments.
References color_pdb::temp, and numeric::random::uniform().
Referenced by numeric::IntervalSet< double >::random_point(), numeric::random::random_range(), and numeric::random::reservoir_sample().
void numeric::random::RandomGenerator::restoreAllStates | ( | std::istream & | in | ) | [static] |
Restores the state of all random number generators from given stream.
References color_pdb::i.
void numeric::random::RandomGenerator::restoreState | ( | std::istream & | in | ) |
References basic::options::OptionKeys::run::seed_offset.
void numeric::random::RandomGenerator::saveAllStates | ( | std::ostream & | out | ) | [static] |
Saves the state of all random number generators to given stream.
References color_pdb::i.
void numeric::random::RandomGenerator::saveState | ( | std::ostream & | out | ) |
References basic::options::OptionKeys::run::seed_offset.
double numeric::random::RandomGenerator::uniform | ( | ) | [inline] |
Return from range [0, 1] (?) uniform random number
The implementation of random_range leads me to believe this is actually [0, 1), like most other random number generators. -IWD
Referenced by gaussian(), gen_pep_bb_sequential(), make_1mer_frags(), mutate_random_residue(), numeric::random::random_permutation(), numeric::IntervalSet< double >::random_point(), numeric::random::WeightedSampler::random_sample(), numeric::random::reservoir_sample(), myMC::roll(), run_pep_prep(), RunPepSpec(), set_pep_csts(), and numeric::random::uniform().