random: uniform_01 usage and mixing boost::random with boost::math::normal
Hello, I have this code: boost::mt19937 mers; boost::uniform_01boost::mt19937 uf01(mers); boost::exponential_distribution<> ed(0.1); I call the operator() on uf01 3 million times, as uf01() I don't quite understand the warning in the documentation about the constructor taking the generator by value. This means that my mers doesn't change between calls to uf01(). Is this bad? Will it affect the quality of the randomness of the uniform numbers generated? I also have boost::math::normal nrm; and I use boost::math::cdf(nrm, …) and boost::math::quantile( nrm, … ); Are there any issues with using both boost∷math∷normal and other distributions from the boost∷random library? Regards,
AMDG Hicham Mouline wrote:
I have this code:
boost::mt19937 mers; boost::uniform_01boost::mt19937 uf01(mers); boost::exponential_distribution<> ed(0.1);
I call the operator() on uf01 3 million times, as uf01()
I don't quite understand the warning in the documentation about the constructor taking the generator by value. This means that my mers doesn't change between calls to uf01(). Is this bad? Will it affect the quality of the randomness of the uniform numbers generated?
If /all/ you do with the generator is to use it in a single boost::uniform_01, then it doesn't matter. If you use the generator for anything else, then you'll get the same sequence multiple times, which is probably bad.
I also have boost::math::normal nrm; and I use boost::math::cdf(nrm, …) and boost::math::quantile( nrm, … );
Are there any issues with using both boost∷math∷normal and other distributions from the boost∷random library?
I don't think so. In Christ, Steven Watanabe
participants (2)
-
Hicham Mouline
-
Steven Watanabe