Project Alice
Loading...
Searching...
No Matches
gsl_cbrng.h File Reference
#include <gsl/gsl_rng.h>
#include <string.h>
Include dependency graph for gsl_cbrng.h:

Go to the source code of this file.

Macros

#define GSL_CBRNG(NAME, CBRNGNAME)
 

Macro Definition Documentation

◆ GSL_CBRNG

#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 ...
}
int main(int argc, char *argv[])
#define GSL_CBRNG(NAME, CBRNGNAME)
Definition: gsl_cbrng.h:67
#define threefry4x32(c, k)

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.

Definition at line 67 of file gsl_cbrng.h.