I have found this example on How to use boost normal distribution classes?
#include <boost/random.hpp>
#include <boost/random/normal_distribution.hpp>
int main() {
boost::mt19937 rng; // I don't seed it on purpouse (it's not relevant)
boost::normal_distribution<> nd(0.0, 1.0);
boost::variate_generator<boost::mt19937&,
boost::normal_distribution<> > var_nor(rng, nd);
int i = 0;
for (; i < 10; ++i) {
double d = var_nor();
std::cout << d << std::endl;
}
}
I was wondering what I have do add to the code to generate a different random numbers each time. I am using the number called produced d in a for loop, but at every time I run the program I always obtain the same numbers. Thank you!!!!