OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Random Class Reference

The CLASSIC random generator. More...

#include <ClassicRandom.h>

Public Member Functions

 Random ()
 Constructor with default seed. More...
 
 Random (int seed)
 Constructor with given seed. More...
 
 ~Random ()
 
void reseed (int seed=123456789)
 Set a new seed. More...
 
double uniform ()
 Uniform distribution. More...
 
void gauss (double &gr1, double &gr2)
 Gaussian distribution. More...
 
int integer ()
 Uniform distribution. More...
 
void init55 (int seed)
 Initialise random number generator. More...
 

Private Member Functions

void irngen ()
 

Private Attributes

int irn [nr]
 
int next
 

Detailed Description

The CLASSIC random generator.

Definition at line 36 of file ClassicRandom.h.

Constructor & Destructor Documentation

◆ Random() [1/2]

Random::Random ( )

Constructor with default seed.

Definition at line 28 of file ClassicRandom.cpp.

References init55().

Here is the call graph for this function:

◆ Random() [2/2]

Random::Random ( int  seed)

Constructor with given seed.

Definition at line 37 of file ClassicRandom.cpp.

References init55(), and Options::seed.

Here is the call graph for this function:

◆ ~Random()

Random::~Random ( )

Definition at line 43 of file ClassicRandom.cpp.

Member Function Documentation

◆ gauss()

void Random::gauss ( double &  gr1,
double &  gr2 
)

Gaussian distribution.

Definition at line 64 of file ClassicRandom.cpp.

References log(), sqrt(), and uniform().

Referenced by Expressions::gauss(), and Expressions::Tgauss().

Here is the call graph for this function:

◆ init55()

void Random::init55 ( int  seed)

Initialise random number generator.

Definition at line 91 of file ClassicRandom.cpp.

References next, and Options::seed.

Referenced by Option::execute(), Random(), and reseed().

◆ integer()

int Random::integer ( )

Uniform distribution.

Definition at line 83 of file ClassicRandom.cpp.

References irn, irngen(), next, and nr.

Here is the call graph for this function:

◆ irngen()

void Random::irngen ( )
private

Definition at line 122 of file ClassicRandom.cpp.

References irn, and nr.

Referenced by integer().

◆ reseed()

void Random::reseed ( int  seed = 123456789)

Set a new seed.

Definition at line 48 of file ClassicRandom.cpp.

References init55(), and Options::seed.

Here is the call graph for this function:

◆ uniform()

double Random::uniform ( )

Uniform distribution.

Definition at line 54 of file ClassicRandom.cpp.

Referenced by gauss(), and Expressions::ranf().

Member Data Documentation

◆ irn

int Random::irn[nr]
private

Definition at line 75 of file ClassicRandom.h.

Referenced by integer(), and irngen().

◆ next

int Random::next
private

Definition at line 78 of file ClassicRandom.h.

Referenced by init55(), and integer().


The documentation for this class was generated from the following files: