
14 Jul
2011
14 Jul
'11
4:04 p.m.
This code should work correctly in 1.47. In 1.46 and prior, you need to use variate_generator.
boost::variate_generator< boost::mt19937&, boost::cauchy_distribution<double> > gen(rng, cauchy);
std::cout << gen() << " ";
Ok, thank you. I had the wrong documentation. Btw. are there any factory functions for the variate_generator? Something like make_variate_generator( rng , cauchy ) which could be nicely use when filling containers with random numbers generate( x.begin() , x.end() , make_variate_generator( rng , cauchy ) );