mt19937 and uniform_real_distribution
问题 I am trying to find an efficient way to implement a uniform(0,1) distribution. Since I have to generate a very large number of samples, I chose mt19937 as engine. I am using the version from the boost library. My question is: what is the difference between using the output of the engine itself vs using uniform_real_distribution? Option #1 std::random_device rd; boost::mt19937 gen(rd()); boost::random::uniform_real_distribution<double> urand(0, 1); for ( int i = 0; i < 1E8; i++ ) { u = urand