12 #include <gsl/gsl_rng.h> 13 #include <gsl/gsl_randist.h> 18 class urand:
public random_gen
20 void operator=(urand&);
21 CLASSDESC_ACCESS(urand);
24 urand(
const gsl_rng_type *descr=gsl_rng_mt19937) {gen=gsl_rng_alloc(descr);}
25 ~urand() {gsl_rng_free(gen);}
26 void Seed(
int s) {gsl_rng_set(gen,s);}
27 void seed(TCL_args args) {Seed(args);}
31 void set_gen(TCL_args args);
32 void Set_gen(
const string& descr)
34 static const gsl_rng_type ** rngTypes=gsl_rng_types_setup();
35 const gsl_rng_type **g=rngTypes;
37 if (descr==(*g)->name)
40 gen=gsl_rng_alloc(*g);
43 if (!*g)
throw error(
"Cannot create generator %s",descr.c_str());
47 class gaussrand:
public random_gen
49 void operator=(gaussrand&);
59 #pragma omit pack ecolab::urand 60 #pragma omit unpack ecolab::urand class to allow access to private members
Definition: classdesc_access.h:21
helper for constructing null descriptors
Definition: classdesc.h:784
class to allow access to private members
Definition: classdesc_access.h:22
#define CLASSDESC_ACCESS(type)
add friend statements for each accessor function
Definition: classdesc_access.h:36
_OPENMP
Definition: accessor.h:16
Contains access_* structs, and nothing else. These structs are used to gain access to private members...
Definition: accessor.h:55