18 #ifndef INCLUDED_numeric_random_random_hh
19 #define INCLUDED_numeric_random_random_hh
41 #if (defined min) && (defined WIN32) // Workaround for MSVC and windows.h include which used #define min
45 #if (defined max) && (defined WIN32) // Workaround for MSVC and windows.h include which used #define max
53 class RandomGenerator;
56 RandomGenerator &
rg();
106 void set_seed( std::string
const & generator_type,
int seed );
121 assert( !v.empty() );
132 double min()
const {
return 0; }
133 double max()
const {
return 1; }
153 #endif // INCLUDED_numeric_random_random_HH
bool gaussian_iset_
data for Gaussian generation
RandomGenerator & rg()
Return the one-per-thread "singleton" random generator.
utility::pointer::shared_ptr< uniform_RG > uniform_RG_OP
ReferenceCount base class – dispatch class.
Non-owning access smart pointer – dispatch class.
Random number generator system.
void saveState(std::ostream &out)
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 ...
Base class for reference-counted polymorphic classes.
void restoreState(std::istream &in)
double gaussian()
Get Gaussian distribution random number.
friend RandomGenerator & rg()
Return the one-per-thread "singleton" random generator.
utility::pointer::shared_ptr< RandomGenerator > RandomGeneratorOP
int get_seed() const
Return the seed used by this RNG.
vector1: std::vector with 1-based indexing
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...
T const & random_element(utility::vector1< T > const &v)
return a random element from a utility::vector1. What is this function doing inside the RandomGenerat...
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...
Random number generator system.