/search.css" rel="stylesheet" type="text/css"/>
/search.js">
- random123-1.11.2pre Documentation
Go to the documentation of this file.
32 #ifndef __r123_gslmicrorng_dot_h__
33 #define __r123_gslmicrorng_dot_h__
36 #include <gsl/gsl_rng.h>
79 #define GSL_MICRORNG(NAME, CBRNGNAME) \
80 const gsl_rng_type *gsl_rng_##NAME; \
83 CBRNGNAME##_ctr_t ctr; \
84 CBRNGNAME##_ctr_t r; \
85 CBRNGNAME##_key_t key; \
90 static unsigned long int NAME##_get(void *vstate){ \
91 NAME##_state *st = (NAME##_state *)vstate; \
92 const int N=sizeof(st->ctr.v)/sizeof(st->ctr.v[0]); \
93 if( st->elem == 0 ){ \
94 CBRNGNAME##_ctr_t c = st->ctr; \
95 c.v[N-1] |= st->n<<(R123_W(CBRNGNAME##_ctr_t)-32); \
97 st->r = CBRNGNAME(c, st->key); \
100 return 0xffffffff & st->r.v[--st->elem]; \
104 NAME##_get_double (void * vstate) \
106 return NAME##_get (vstate)/4294967296.; \
109 static void NAME##_set(void *vstate, unsigned long int s){ \
110 NAME##_state *st = (NAME##_state *)vstate; \
116 static const gsl_rng_type NAME##_type = { \
120 sizeof(NAME##_state), \
126 R123_STATIC_INLINE void NAME##_reset(const gsl_rng* gr, CBRNGNAME##_ctr_t c, CBRNGNAME##_key_t k) { \
127 NAME##_state* state = (NAME##_state *)gr->state; \
134 const gsl_rng_type *gsl_rng_##NAME = &NAME##_type