C++ mpi module for stochmagnet_main Package
Public Member Functions | List of all members
TRNG_RandomNumberGenerator< T, I, D > Class Template Reference

This class generates a random number of type T generator with implement class I by process. More...

#include <TRNG_RandomNumberGenerator.h>

Inheritance diagram for TRNG_RandomNumberGenerator< T, I, D >:
Inheritance graph
[legend]
Collaboration diagram for TRNG_RandomNumberGenerator< T, I, D >:
Collaboration graph
[legend]

Public Member Functions

 TRNG_RandomNumberGenerator (void)
 create the class
 
virtual ~TRNG_RandomNumberGenerator (void)
 destroy the class
 
virtual tMemSize getMemorySize () const
 return the memory size of the class and the memory size of all its attributes/associations More...
 
virtual tMemSize getContentsMemorySize () const
 return nthe memory size of the included associations More...
 
template<typename T1 , class I1 , class D1 >
void generateSeed (TRNG_RandomNumberGenerator< T1, I1, D1 > &s)
 initialize seed More...
 
void split (const tUInt &n, const tUInt &p)
 split the generator per core More...
 
- Public Member Functions inherited from RAND_RandomNumberGenerator< T, I, D >
T & operator() ()
 return the internal generator
 
void setSeed (const tULInt &seed)
 initialize the seed of the random number generator More...
 
void setSeed ()
 initialize the seed of the generator with time(null) by defualt
 
minValue () const
 get the min value More...
 
maxValue () const
 get the max value More...
 
I & getGenerator ()
 get the internal random nulber generator More...
 
- Public Member Functions inherited from CORE_Object
template<class T >
std::shared_ptr< T > getSharedPointer ()
 return the shared pointer for this More...
 
template<class T >
std::shared_ptr< const T > getConstSharedPointer () const
 return a const shared pointer for this More...
 
template<class T >
tBoolean isInstanceOf () const
 test if the clas T is an instance of this class More...
 
tString getClassName () const
 return the name of the class More...
 
tString getPointerString () const
 retrun the pointer of the class as a string More...
 
tString getIdentityString () const
 retrun the string identification of the class More...
 
virtual tString toString () const
 return the string representation of the object node More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 
- Protected Member Functions inherited from RAND_RandomNumberGenerator< T, I, D >
 RAND_RandomNumberGenerator (void)
 create
 
virtual ~RAND_RandomNumberGenerator (void)
 destroy
 
- Protected Member Functions inherited from RAND_Object
 RAND_Object (void)
 create the class
 
virtual ~RAND_Object (void)
 delete the class
 
- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Detailed Description

template<typename T, class I, class D>
class TRNG_RandomNumberGenerator< T, I, D >

This class generates a random number of type T generator with implement class I by process.

Author
Stephane Despreaux
Version
2.0

Member Function Documentation

◆ generateSeed()

template<typename T , class I , class D >
template<typename T1 , class I1 , class D1 >
void TRNG_RandomNumberGenerator< T, I, D >::generateSeed ( TRNG_RandomNumberGenerator< T1, I1, D1 > &  s)
inline

initialize seed

Parameters
[in]svaue of seed

◆ getContentsMemorySize()

template<typename T , class I , class D >
virtual tMemSize TRNG_RandomNumberGenerator< T, I, D >::getContentsMemorySize ( ) const
inlinevirtual

◆ getMemorySize()

template<typename T , class I , class D >
virtual tMemSize TRNG_RandomNumberGenerator< T, I, D >::getMemorySize ( ) const
inlinevirtual

return the memory size of the class and the memory size of all its attributes/associations

Returns
the memory size of the class and the memory size of its attributes/associations in bytes The mamory size is :
  • the added size of the base classes which contains:
    • the primary attributes size depends on the order: (first delare the smallest attributes size
    • all virtual functions costs <pointer-size> (4 32xor 8 64x) bytes by virtual function
    • virtual inherihtance will increase of (4 or 8) bytes
  • we add the size of the contains values of the attributes : for example the size of a string is the length of the string 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from RAND_RandomNumberGenerator< T, I, D >.

Reimplemented in TRNG_YARN2, TRNG_ParallelRandomNumberGenerator< T, I, D >, TRNG_ParallelRandomNumberGenerator< int32_t, trng::mrg5, TRNG_MRG5 >, TRNG_ParallelRandomNumberGenerator< int32_t, trng::mrg5s, TRNG_MRG5s >, TRNG_ParallelRandomNumberGenerator< int32_t, trng::mrg3s, TRNG_MRG3s >, TRNG_ParallelRandomNumberGenerator< int32_t, trng::mrg3, TRNG_MRG3 >, TRNG_ParallelRandomNumberGenerator< int32_t, trng::mrg2, TRNG_MRG2 >, TRNG_ParallelRandomNumberGenerator< int32_t, trng::yarn2, TRNG_YARN2 >, TRNG_ParallelRandomNumberGenerator< int32_t, trng::mrg4, TRNG_MRG4 >, TRNG_ParallelRandomNumberGenerator< int32_t, trng::lcg64, TRNG_LCG64 >, TRNG_MT19937, TRNG_MRG5s, TRNG_MRG5, TRNG_MRG4, TRNG_MRG3s, TRNG_MRG3, TRNG_MRG2, and TRNG_LCG64.

◆ split()

template<typename T , class I , class D >
void TRNG_RandomNumberGenerator< T, I, D >::split ( const tUInt &  n,
const tUInt &  p 
)
inline

split the generator per core

Parameters
[in]n: number of the cores
[in]p: p in [0,n-1] : index of the core

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