X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=simul.h;h=b62132a66a636115c3484073d7277bc5898d0eeb;hp=ba105dbde965dfadb1deeaeb7def93e3357cbb9b;hb=refs%2Fheads%2Fmaster;hpb=58f823f5be6dfbe00896fc44ac3aac5e881e9c5c diff --git a/simul.h b/simul.h index ba105db..b62132a 100644 --- a/simul.h +++ b/simul.h @@ -1,7 +1,6 @@ #ifndef SIMUL_H_ #define SIMUL_H_ -#include #include #include "boost/random.hpp" @@ -9,8 +8,8 @@ class simul { public: - simul() : rg(boost::mt19937(time(NULL))) { - } + simul(unsigned int seed) : engine(seed), rg(engine, boost::random::uniform_01<>()) { + } // interval : [,) // random number should be in [0, arr[len - 1]) @@ -36,7 +35,8 @@ public: double random() { return rg(); }; private: - boost::uniform_01 rg; + boost::random::mt19937 engine; + boost::random::variate_generator > rg; }; #endif /* SIMUL_H_ */