76 gaussian_iset_( true ),
103 double v1, v2, rsq, fac;
107 rsq = ( v1 * v1 ) + ( v2 * v2 );
108 }
while ( rsq >= 1.0 || rsq == 0.0 );
109 fac = std::sqrt(-(2.0*
std::log(rsq)/rsq));
135 int const range( high - low + 1 );
146 std::string
const & generator_type,
#define utility_exit_with_message(m)
Exit with file + line + message.
bool gaussian_iset_
data for Gaussian generation
uniform_RG_OP createRG(string const &type)
uniform_RG factory
RandomGenerator & rg()
Return the one-per-thread "singleton" random generator.
utility::pointer::shared_ptr< uniform_RG > uniform_RG_OP
Random number generator system.
void saveState(std::ostream &out)
Generator based on rand() < clib > function.
Random number generator system.
double log(double x, double base)
Computes log(x) in the given base.
double gaussian()
Generate a random number pulled from a standard normal – i.e. mean of zero and standard deviation of...
int random_range(int low, int high)
Return a number uniformly drawn from the inclusive range between low and high. Threadsafe since each ...
File to provide backwards compatibility for the thread_local keyword.
void restoreState(std::istream &in)
double gaussian()
Get Gaussian distribution random number.
Program exit functions and macros.
utility::pointer::shared_ptr< RandomGenerator > RandomGeneratorOP
int get_seed() const
Return the seed used by this RNG.
Mersenne Twister 19937 random number generator.
int random_range(int low, int high)
Returns a random int in the range specified by the arguments.
double uniform()
Generate a random number between 0 and 1. Threadsafe since each thread uses its own random generator...
void set_seed(std::string const &generator_type, int seed)
Set the seed and the generator type synchronously. Currently the two supported generator types are "s...
static RandomGeneratorOP random_generator(0)