Since C++11, the C++ standard library contains high-quality facilities for random number generation, divided into engines (things that produce random bits) and random distributions and algorithms that are driven by a user-provided engine.

Some of the engines are deterministic, so that with a given seed they are specified to produce a particular sequence of random bits. But this is not enough to produce portable software that has the same pseudo-random behaviour everywhere given the same random seed. The details of the random distributions (e.g. uniform_int_distribution, chi_squared_distribution, etc.) and of algorithms (such as shuffle) are not specified, and thus may produce different results on different platforms.

I would like random distributions and algorithms that are deterministic and reproducible, ideally using a C++11 random number engine as the source of randomness. Does a library like that exist?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.