Hi,
I would like to know if in C++ standard libraries there is any gaussian distribution number generator, or if you have any code snippet to pass.
Thanks in advance.
Hi,
I would like to know if in C++ standard libraries there is any gaussian distribution number generator, or if you have any code snippet to pass.
Thanks in advance.
The standard library does not. Boost.Random does, however. I'd use that if I were you.
The GNU Scientific Libraries has this feature. GSL - Gaussian Distribution
C++ Technical Report 1 adds support for random number generation. So if you're using a relatively recent compiler (visual c++ 2008 GCC 4.3), chances are that it is available out of the box.
See here for sample usage of std::tr1::normal_distribution
(and many more).