OpenMD  2.5
Molecular Dynamics in the Open
OpenMD::RandNumGen Class Referenceabstract

a random number generator class More...

#include <RandNumGen.hpp>

Inheritance diagram for OpenMD::RandNumGen:
OpenMD::ParallelRandNumGen OpenMD::SeqRandNumGen

Public Types

typedef unsigned long uint32
 

Public Member Functions

virtual ~RandNumGen ()
 
RealType rand ()
 
RealType rand (const RealType &n)
 
RealType randExc ()
 
RealType randExc (const RealType &n)
 
RealType randDblExc ()
 
RealType randDblExc (const RealType &n)
 
uint32 randInt ()
 
uint32 randInt (const uint32 &n)
 
RealType rand53 ()
 
RealType randNorm (const RealType mean, const RealType variance)
 
virtual void seed (const uint32 oneSeed)=0
 
virtual void seed ()=0
 

Protected Attributes

MTRandmtRand_
 

Detailed Description

a random number generator class

Definition at line 58 of file RandNumGen.hpp.

Member Typedef Documentation

◆ uint32

typedef unsigned long OpenMD::RandNumGen::uint32

Definition at line 60 of file RandNumGen.hpp.

Constructor & Destructor Documentation

◆ ~RandNumGen()

virtual OpenMD::RandNumGen::~RandNumGen ( )
inlinevirtual

Definition at line 62 of file RandNumGen.hpp.

References mtRand_.

Member Function Documentation

◆ rand() [1/2]

RealType OpenMD::RandNumGen::rand ( )
inline

Returns a real number in [0,1]

Definition at line 67 of file RandNumGen.hpp.

References mtRand_, and OpenMD::MTRand::rand().

Referenced by OpenMD::SimCreator::divideMolecules().

◆ rand() [2/2]

RealType OpenMD::RandNumGen::rand ( const RealType &  n)
inline

Returns a real number in [0, n]

Definition at line 72 of file RandNumGen.hpp.

References mtRand_, and OpenMD::MTRand::rand().

◆ rand53()

RealType OpenMD::RandNumGen::rand53 ( )
inline

Returns a 53-bitreal number in [0,1) (capacity of IEEE RealType precision)

Definition at line 107 of file RandNumGen.hpp.

References mtRand_, and OpenMD::MTRand::rand53().

◆ randDblExc() [1/2]

RealType OpenMD::RandNumGen::randDblExc ( )
inline

Returns a real number in (0, 1)

Definition at line 87 of file RandNumGen.hpp.

References mtRand_, and OpenMD::MTRand::randDblExc().

◆ randDblExc() [2/2]

RealType OpenMD::RandNumGen::randDblExc ( const RealType &  n)
inline

Returns a real number in (0, n)

Definition at line 92 of file RandNumGen.hpp.

References mtRand_, and OpenMD::MTRand::randDblExc().

◆ randExc() [1/2]

RealType OpenMD::RandNumGen::randExc ( )
inline

Returns a real number in [0, 1)

Definition at line 77 of file RandNumGen.hpp.

References mtRand_, and OpenMD::MTRand::randExc().

◆ randExc() [2/2]

RealType OpenMD::RandNumGen::randExc ( const RealType &  n)
inline

Returns a real number in [0, n)

Definition at line 82 of file RandNumGen.hpp.

References mtRand_, and OpenMD::MTRand::randExc().

◆ randInt() [1/2]

uint32 OpenMD::RandNumGen::randInt ( )
inline

Returns aninteger in [0,2^32-1]

Definition at line 97 of file RandNumGen.hpp.

References mtRand_, and OpenMD::MTRand::randInt().

◆ randInt() [2/2]

uint32 OpenMD::RandNumGen::randInt ( const uint32 n)
inline

Returns aninteger in [0, n] for n < 2^32

Definition at line 102 of file RandNumGen.hpp.

References mtRand_, and OpenMD::MTRand::randInt().

◆ randNorm()

RealType OpenMD::RandNumGen::randNorm ( const RealType  mean,
const RealType  variance 
)
inline

◆ seed() [1/2]

virtual void OpenMD::RandNumGen::seed ( const uint32  oneSeed)
pure virtual

◆ seed() [2/2]

virtual void OpenMD::RandNumGen::seed ( )
pure virtual

Implemented in OpenMD::ParallelRandNumGen, and OpenMD::SeqRandNumGen.

Referenced by randNorm().

Member Data Documentation

◆ mtRand_


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