#include <gsl/gsl_rng.h>
#include <string.h>
Go to the source code of this file.
Defines | |
#define | GSL_CBRNG(NAME, CBRNGNAME) |
#define GSL_CBRNG | ( | NAME, | ||
CBRNGNAME | ||||
) |
The macro: GSL_CBRNG(NAME, CBRNGNAME) declares the necessary structs and constants that define a gsl_rng_NAME type based on the counter-based RNG CBRNGNAME. For example:
Usage:
#include <Random123/threefry.h> #include <Random123/conventional/gsl_cbrng.h> // this file GSL_CBRNG(cbrng, threefry4x32); // creates gsl_rng_cbrng int main(int argc, char **argv){ gsl_rng *r = gsl_rng_alloc(gsl_rng_cbrng); ... use r as you would use any other gsl_rng ... }
It requires that NAME be the name of a CBRNG that follows the naming and stylistic conventions of the Random123 library.
Note that wrapping a counter-based PRNG with a traditional API in this way obscures much of the power of the CBRNG API. Nevertheless, it may be of value to applications that are already coded to work with GSL random number generators, and that wish to use the RNGs in the Random123 library.