aarand
Aaron's random distribution functions
|
This library implements distribution functions to convert random numbers from C++11 (P)RNGs into samples of the relevant distribution. It provides implementations of some of the standard distribution functions in <random>
, namely the uniform and normal distributions. Why is a separate library necessary? Because the standard functions are not guaranteed to give the same result across different library implementations - see discussion here - and I don't want to drag Boost into my project dependencies.
Usage is pretty simple - just plug in your favorite PRNG into desired distribution function:
Check out the reference documentation for more details.
FetchContent
If you're already using CMake, you can add something like this to your CMakeLists.txt
:
And then:
find_package()
To install the library, clone a suitable version of this repository and run:
Then we can just use find_package()
as usual:
Copy and paste the aarand.hpp
header file into your project and #include
it as appropriate.
Currently, only the bare bones are available:
standard_uniform
)standard_normal
)standard_exponential
)discrete_uniform
)shuffle
)sample
)Contributions are welcome.