Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
RandomPool.hpp
Go to the documentation of this file.
1 
8 #ifndef __RANDOMPOOL_HPP_
9 #define __RANDOMPOOL_HPP_
10 
11 #include "MersenneTwister.hpp"
12 
14 class RandomPool {
15 private:
16  RandomPool();
17  RandomPool (const RandomPool&);
20 
21  static const size_t size = 1000000;
22 
23  MTRand generator;
24  size_t counter;
25  double numbers[size];
26 public:
28  static RandomPool* get();
29 
30  void Generate(void);
31 
34  double Get(double range = 1);
35 };
36 
37 #endif // __RANDOMPOOL_HPP_
void Generate(void)
Generates a random number.
size_t counter
current random number index
Definition: RandomPool.hpp:24
double Get(double range=1)
static const size_t size
default size of the pool
Definition: RandomPool.hpp:21
RandomPool & operator=(RandomPool const &)
the copy constructor
static RandomPool * instance
static instance of the class
Definition: RandomPool.hpp:19
MTRand generator
random number generator
Definition: RandomPool.hpp:23
double numbers[size]
the pool of random numbers
Definition: RandomPool.hpp:25
A random pool of numbers using Mersenne twister - Singleton Class.
Definition: RandomPool.hpp:14
RandomPool()
Default constructor.