Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
RandomPool Class Reference

A random pool of numbers using Mersenne twister - Singleton Class. More...

#include <RandomPool.hpp>

Collaboration diagram for RandomPool:

Public Member Functions

void Generate (void)
 Generates a random number.
 
double Get (double range=1)
 

Static Public Member Functions

static RandomPoolget ()
 

Private Member Functions

 RandomPool ()
 Default constructor.
 
 RandomPool (const RandomPool &)
 Overload of the constructor.
 
RandomPooloperator= (RandomPool const &)
 the copy constructor
 

Private Attributes

MTRand generator
 random number generator
 
size_t counter
 current random number index
 
double numbers [size]
 the pool of random numbers
 

Static Private Attributes

static RandomPoolinstance
 static instance of the class
 
static const size_t size = 1000000
 default size of the pool
 

Detailed Description

A random pool of numbers using Mersenne twister - Singleton Class.

Member Function Documentation

static RandomPool* RandomPool::get ( )
static
Returns
The only instance to the random pool
double RandomPool::Get ( double  range = 1)
Returns
a random number in the specified range [0, range]
Parameters
[in]range: the upper bound for the range to get

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