ODT
Loading...
Searching...
No Matches
randomGenerator.h
Go to the documentation of this file.
1
7
8#pragma once
9
10#include "MersenneTwister.h"
11#include "processor.h"
12
17//
18
19extern processor proc;
20
22
23 private :
24
26
27 public :
28
29 inline double getRand() {
30 return mtwist.rand();
31 }
32 inline int getRandInt(unsigned n) {
33 return mtwist.randInt(n);
34 }
35
36 randomGenerator(const int aseed) : mtwist(proc.myid + aseed) {
37 //randomGenerator(const int aseed) : mtwist(aseed) {
38 if(aseed < 0) // randomize the seed
39 mtwist.seed();
40 }
42};
43
44
45
void seed(const uint32 oneSeed)
double rand()
uint32 randInt()
int getRandInt(unsigned n)
MTRand mtwist
Mersenne twister object.
randomGenerator(const int aseed)
Header file for class processor.
processor proc
Definition main.cc:28