4 ms·
The indirectly linked stackoverflow https://stackoverflow.com/questions/14840901/is-the-random-library-in-c11-portable https://stackoverflow.com/questions/14840
by jepler 5y ago
The indirectly linked stackoverflow https://stackoverflow.com/questions/14840901/is-the-random-library-in-c11-portable https://stackoverflow.com/questions/14840901/is-the-random-l... goes into more detail: mt19937 is, but distributions (particularly, based on my experience a few years ago, floating point ones) are not. If you have to build your own distribution functions, you may as well base them on a better PRNG than is in the C++ standard.
- OskarS 5y agoIn the context of that sentence though, it doesn’t make any sense. PCG is a PRNG, not a library for generating distributions. In fact, the PCG documentation uses the distributions from <random>: [1]. If people want to use PCG, that’s perfectly fine, it’s a great library. My point is, there’s nothing wrong with the PRNGs in <random>, they work great. Mersenne Twister is not state of the art anymore, but I guarantee you that unless you’re doing something truly insane, neither the throughput nor the statistical properties of MT is gonna be your bottleneck. [1]: https://www.pcg-random.org/using-pcg-cpp.html https://www.pcg-random.org/using-pcg-cpp.html