PROFASI
Version 1.5
|
Ran3nEngine is the default random number generator class for profasi. More...
#include <Ran3nEngine.hh>
Public Member Functions | |
double | shoot () |
Generates a random number distributed uniformly between 0 and 1. | |
void | ResetDefaultState (long seedd) |
Initialize with a given seed. | |
![]() | |
int | createSeed (int inpseed) |
Generate a seed from process id, time ... | |
double | shoot (double a, double b) |
As above, but between a and b. | |
double | shoot (double width) |
Between 0 and width. | |
int | shootBit () |
Create a random bit, 0 or 1 with equal probabilities. | |
virtual void | WriteTo (FILE *cnfil) |
Write to a file. | |
virtual void | ReadFrom (FILE *cnfil) |
Read in the state of the generator from a file. | |
virtual void | WriteTo_text (FILE *cnfil) |
Write to a file in text form. | |
virtual void | ReadFrom_text (FILE *cnfil) |
Read in the state of the generator from a file in text form. | |
virtual void | RandomizeState (int irnk=0) |
Randomize State based on a given "rank". | |
virtual void | retrace (std::string sttfile="") |
Retrace history. | |
void | set_seed_and_ncalls (long sd, unsigned long ncl) |
Set seed and num_calls (to later call retrace) | |
unsigned long | num_calls () |
Retrieve number of calls. | |
virtual void | setSeed (long i) |
Sets seed and Initializes with it. | |
long | Seed () const |
Returns the seed. | |
virtual void | saveState (std::string sttfile) |
Save complete state for faster recovery. | |
virtual int | recoverState (std::string sttfile) |
Recover complete state from file. | |
Ran3nEngine inherits from RandomNumberBase and implements a method given in Numerical Recipes in C. It overrides the shoot() function which