14 Sep
2009
14 Sep
'09
3:30 p.m.
AMDG Stefan Strasser wrote:
a little OT: is there a random number generator in boost.random that is comparable to rand()? I recently needed some low-quality random numbers, and every random number generated in boost.random I tried was way too slow, slower than the alternative I tried to avoid by using random numbers (a mutex lock). so I ended up writing an own rand() function, as C rand() has global state so it can't be used from multiple threads.
There are several linear congruential generators: minstd_rand0, minstd_rand, and rand48 all defined in boost/random/linear_congruential.hpp In Christ, Steven Watanabe