Rosetta 3.3
Public Member Functions | Static Public Member Functions
numeric::random::RandomGenerator Class Reference

Random number generator system. More...

#include <random.hh>

Collaboration diagram for numeric::random::RandomGenerator:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

Random number generator system.


Constructor & Destructor Documentation

numeric::random::RandomGenerator::RandomGenerator ( int const  magicNumber)
numeric::random::RandomGenerator::~RandomGenerator ( )

References begin, and color_pdb::i.


Member Function Documentation

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: Numerical Recipes, section 7.2, a.k.a. "GASDEV"
Author:
JJG 4/01

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().

int numeric::random::RandomGenerator::random_range ( int  low,
int  high 
)

Returns a random int in the range specified by the arguments.

Author:
XA

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)
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)
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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines