00001 #ifndef MERSENNETWISTER_H 00002 #define MERSENNETWISTER_H 00003 00004 #include <boost/random/mersenne_twister.hpp> 00005 #include <boost/random/uniform_real.hpp> 00006 #include <boost/random/variate_generator.hpp> 00007 00008 00009 class MersenneTwister 00010 { 00011 public: 00012 MersenneTwister():dist(0,1),die(gen,dist) 00013 { 00014 } 00015 00016 double getRandomNormalizedDouble() 00017 { 00018 return die(); 00019 } 00020 00021 private: 00022 boost::mt19937 gen; 00023 boost::uniform_real<> dist; 00024 boost::variate_generator<boost::mt19937&, boost::uniform_real<> > die; 00025 }; 00026 00027 #endif //MERSENNETWISTER_H