Random number generators¶
The random number generator type is fwdpp::GSLrng_mt
, which is a mersenne twister.
The class constructor accepts a single, 32-bit unsigned integer.
This class is effectively a unique_ptr
with a custom deleter.
As such, it defines a move-only type.
fwdpp::GSLrng_mt
is defined as a template typedef
of fwdpp::GSLrng_t
.
The function fwdpp::GSLrng_t::get()
returns the underlying const gsl_rng *.
These types are defined in File GSLrng_t.hpp.
To use this type:
#include <fwdpp/GSLrng_t.hpp>
int main(int, char **)
{
// Initialize with a seed.
fwdpp::GSLrng_mt(42);
}
Note
Most or all of fwdpp
is compatible with using a “bare” gsl_rng *
.
However, you give up exception safety by doing so.