ExRandom  2.1
Getting started
Back to Simple examples. Forward to Compiling all the examples. Up to Contents.

Prerequisites:

If you just want to use the library to get at accurate random deviates, then you should use the interfaces providing C++11 random distributions. These work in exactly the same manner as, for example, std::normal_distribution. The distributions provided are

The first three distributions are templated and can return any floating point type. The last distribution returns ints.

The entire library is header-only. Thus all you have to do is set the include path to the parent directory containing the exrandom include directory. Everything is in the exrandom namespace. So the typical invocation is

#include <random>
...
auto g = std::mt19937(std::random_device()());
double x = N(g); // a normal deviate
...
Back to Simple examples. Forward to Compiling all the examples. Up to Contents.