GNU g++  v5.2.1
GNU Standard C++
__gnu_parallel::_RandomNumber Class Reference

Random number generator, based on the Mersenne twister. More...

#include <random_number.h>

Collaboration diagram for __gnu_parallel::_RandomNumber:

Public Member Functions

 _RandomNumber ()
 Default constructor. More...
 
 _RandomNumber (uint32_t __seed, uint64_t _M_supremum=0x100000000ULL)
 Constructor. More...
 
unsigned long __genrand_bits (int __bits)
 Generate a number of random bits, run-time parameter. More...
 
uint32_t operator() ()
 Generate unsigned random 32-bit integer. More...
 
uint32_t operator() (uint64_t local_supremum)
 Generate unsigned random 32-bit integer in the interval [0,local_supremum). More...
 

Static Private Member Functions

static uint32_t __scale_down (uint64_t __x, uint64_t _M_supremum, double)
 

Private Attributes

int __bits_left
 
uint64_t __cache
 
std::tr1::mt19937 _M_mt
 
uint64_t _M_rand_sup
 
double _M_rand_sup_reciprocal
 
uint64_t _M_supremum
 
double _M_supremum_reciprocal
 

Detailed Description

Random number generator, based on the Mersenne twister.

Constructor & Destructor Documentation

__gnu_parallel::_RandomNumber::_RandomNumber ( )
inline

Default constructor.

Seed with 0.

__gnu_parallel::_RandomNumber::_RandomNumber ( uint32_t  __seed,
uint64_t  _M_supremum = 0x100000000ULL 
)
inline

Constructor.

Parameters
__seedRandom __seed.
_M_supremumGenerate integer random numbers in the interval [0,_M_supremum).

Member Function Documentation

unsigned long __gnu_parallel::_RandomNumber::__genrand_bits ( int  __bits)
inline

Generate a number of random bits, run-time parameter.

Parameters
__bitsNumber of bits to generate.

References _M_mt.

static uint32_t __gnu_parallel::_RandomNumber::__scale_down ( uint64_t  __x,
uint64_t  _M_supremum,
double   
)
inlinestaticprivate

References _M_supremum.

Referenced by operator()().

Here is the caller graph for this function:

uint32_t __gnu_parallel::_RandomNumber::operator() ( )
inline

Generate unsigned random 32-bit integer.

References __scale_down(), and _M_mt.

Here is the call graph for this function:

uint32_t __gnu_parallel::_RandomNumber::operator() ( uint64_t  local_supremum)
inline

Generate unsigned random 32-bit integer in the interval [0,local_supremum).

References __scale_down(), and _M_mt.

Here is the call graph for this function:

Member Data Documentation

int __gnu_parallel::_RandomNumber::__bits_left
private
uint64_t __gnu_parallel::_RandomNumber::__cache
private
std::tr1::mt19937 __gnu_parallel::_RandomNumber::_M_mt
private

Referenced by __genrand_bits(), and operator()().

uint64_t __gnu_parallel::_RandomNumber::_M_rand_sup
private
double __gnu_parallel::_RandomNumber::_M_rand_sup_reciprocal
private
uint64_t __gnu_parallel::_RandomNumber::_M_supremum
private

Referenced by __scale_down().

double __gnu_parallel::_RandomNumber::_M_supremum_reciprocal
private

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