Open Babel
3.0
|
#include <openbabel/rand.h>
Public Member Functions | |
OBRandom (bool useSys=false) | |
void | Seed (int seed) |
void | TimeSeed () |
int | NextInt () |
double | NextFloat () |
Random number generator.
The OBRandom class can be used to facilitate cross-platform random number generation. The class can be set to specific seed states, or set to use the current time or other arbitrary data as a seed.
Alternatively, OBRandom can be used as an interface to the system random number generator.
OBRandom | ( | bool | useSys = false | ) |
Constructor. useSys
will use the system rand() function.
|
inline |
Use seed
for the random number generator seed.
void TimeSeed | ( | ) |
Use the current time for the random number generator seed If sranddev is available (e.g., Mac OS X, BSD...) use this instead for more random seeds
Referenced by OBForceField::GenerateVelocities(), OBConformerSearch::OBConformerSearch(), OBRandom::OBRandom(), OBForceField::RandomRotorSearchInitialize(), OBRandom::Seed(), OBConformerSearch::Setup(), and OBForceField::WeightedRotorSearch().
int NextInt | ( | ) |
Referenced by OBForceField::RandomRotorSearchInitialize(), OBRandom::Seed(), and OBConformerSearch::Setup().
double NextFloat | ( | ) |
Referenced by OBForceField::GenerateVelocities(), vector3::randomUnitVector(), OBRandom::Seed(), and OBForceField::WeightedRotorSearch().