OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
SimpleRNG Class Reference

SimpleRNG is a simple random number generator based on George Marsaglia's MWC (multiply with carry) generator. Although it is very simple, it passes Marsaglia's DIEHARD series of random number generator tests. More...

Detailed Description

SimpleRNG is a simple random number generator based on George Marsaglia's MWC (multiply with carry) generator. Although it is very simple, it passes Marsaglia's DIEHARD series of random number generator tests.

Written by John D. Cook http://www.johndcook.com Converted to C++ by Pietro Incardona

Definition at line 18 of file SimpleRNG.hpp.

#include <SimpleRNG.hpp>

Public Member Functions

void SetSeed (unsigned int u, unsigned int v)
 
void SetSeed (unsigned int u)
 
void SetSeedFromSystemTime ()
 
double GetUniform ()
 
double GetNormal ()
 
double GetNormal (double mean, double standardDeviation)
 
double GetExponential ()
 
double GetExponential (double mean)
 
double GetGamma (double shape, double scale)
 
double GetChiSquare (double degreesOfFreedom)
 
double GetInverseGamma (double shape, double scale)
 
double GetWeibull (double shape, double scale)
 
double GetCauchy (double median, double scale)
 
double GetStudentT (double degreesOfFreedom)
 
double GetLaplace (double mean, double scale)
 
double GetLogNormal (double mu, double sigma)
 
double GetBeta (double a, double b)
 

Private Member Functions

unsigned int GetUint ()
 

Private Attributes

unsigned int m_w
 
unsigned int m_z
 

Constructor & Destructor Documentation

◆ SimpleRNG()

SimpleRNG::SimpleRNG ( )
inline

Definition at line 36 of file SimpleRNG.hpp.

Member Function Documentation

◆ GetBeta()

double SimpleRNG::GetBeta ( double  a,
double  b 
)
inline

Definition at line 222 of file SimpleRNG.hpp.

◆ GetCauchy()

double SimpleRNG::GetCauchy ( double  median,
double  scale 
)
inline

Definition at line 180 of file SimpleRNG.hpp.

◆ GetChiSquare()

double SimpleRNG::GetChiSquare ( double  degreesOfFreedom)
inline

Definition at line 156 of file SimpleRNG.hpp.

◆ GetExponential() [1/2]

double SimpleRNG::GetExponential ( )
inline

Definition at line 100 of file SimpleRNG.hpp.

◆ GetExponential() [2/2]

double SimpleRNG::GetExponential ( double  mean)
inline

Definition at line 106 of file SimpleRNG.hpp.

◆ GetGamma()

double SimpleRNG::GetGamma ( double  shape,
double  scale 
)
inline

Definition at line 116 of file SimpleRNG.hpp.

◆ GetInverseGamma()

double SimpleRNG::GetInverseGamma ( double  shape,
double  scale 
)
inline

Definition at line 163 of file SimpleRNG.hpp.

◆ GetLaplace()

double SimpleRNG::GetLaplace ( double  mean,
double  scale 
)
inline

Definition at line 209 of file SimpleRNG.hpp.

◆ GetLogNormal()

double SimpleRNG::GetLogNormal ( double  mu,
double  sigma 
)
inline

Definition at line 217 of file SimpleRNG.hpp.

◆ GetNormal() [1/2]

double SimpleRNG::GetNormal ( )
inline

Definition at line 78 of file SimpleRNG.hpp.

◆ GetNormal() [2/2]

double SimpleRNG::GetNormal ( double  mean,
double  standardDeviation 
)
inline

Definition at line 89 of file SimpleRNG.hpp.

◆ GetStudentT()

double SimpleRNG::GetStudentT ( double  degreesOfFreedom)
inline

Definition at line 194 of file SimpleRNG.hpp.

◆ GetUint()

unsigned int SimpleRNG::GetUint ( )
inlineprivate

Definition at line 27 of file SimpleRNG.hpp.

◆ GetUniform()

double SimpleRNG::GetUniform ( )
inline

Definition at line 68 of file SimpleRNG.hpp.

◆ GetWeibull()

double SimpleRNG::GetWeibull ( double  shape,
double  scale 
)
inline

Definition at line 170 of file SimpleRNG.hpp.

◆ SetSeed() [1/2]

void SimpleRNG::SetSeed ( unsigned int  u)
inline

Definition at line 55 of file SimpleRNG.hpp.

◆ SetSeed() [2/2]

void SimpleRNG::SetSeed ( unsigned int  u,
unsigned int  v 
)
inline

Definition at line 49 of file SimpleRNG.hpp.

◆ SetSeedFromSystemTime()

void SimpleRNG::SetSeedFromSystemTime ( )
inline

Definition at line 60 of file SimpleRNG.hpp.

Field Documentation

◆ m_w

unsigned int SimpleRNG::m_w
private

Definition at line 21 of file SimpleRNG.hpp.

◆ m_z

unsigned int SimpleRNG::m_z
private

Definition at line 22 of file SimpleRNG.hpp.


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