PRNG-C provides an interface for pseudo random number generators compatible with C (C89 and up) and C++ (C++98 and up). This library is header-only.
Its primary intention is serve statistical simulations. Therefore, this library includes specific distributions which a random sample can be drawn from.
This library is namespaced for both C and C++.
In C all functions and complex
data structures are prefixed by PRNG_
if it is meant to be a consumer API or
by prng_
if it is meant to be used internally.
In C++ the namespace prng
is set. All functions and complex data structures
are written in Pascal case if they are meant for consumer APIs and camelCase if
they are used internally.
In the following only the C namespace is used.
-
xorshift1024*
(here) is given asstruct PRNG_Xorshift1024Star
. -
splitmix64
(here) is only used for seeding. It is given asstruct prng_sm64
.
- Normal distribution with mean 0 and standard deviation 1:
PRNG_BoxMuller
.
... to be done ...
C as well as C++ examples can be found in the examples
directory.