#include <random_generator.h>
Public Methods | |
random_generator (const random_generator &other) | |
Default args reads environment variable GSL_RNG_TYPE and GSL_RNG_SEED to initialize. If these are not set the generator gsl_rng_mt19937 will be used with seed 0. More... | |
random_generator (const gsl_rng_type *type=NULL, unsigned long int seed=0) | |
~random_generator () | |
random_generator& | operator= (const random_generator &other) |
void | set (unsigned long int seed) |
unsigned long int | get (unsigned long int n=0) |
double | uniform () |
double | uniform_positive () |
string | name () |
unsigned long int | max () |
unsigned long int | min () |
gsl_rng* | gslobj () |
const gsl_rng* | gslobj () const |
|
Default args reads environment variable GSL_RNG_TYPE and GSL_RNG_SEED to initialize. If these are not set the generator gsl_rng_mt19937 will be used with seed 0.
Definition at line 32 of file random_generator.h. 00032 : generator(NULL) {generator = gsl_rng_clone(other.generator);} |
|
Definition at line 33 of file random_generator.h. 00033 : generator(NULL) 00034 { 00035 gsl_rng_env_setup(); 00036 if (!type) 00037 { 00038 generator = gsl_rng_alloc (gsl_rng_default); 00039 } 00040 else 00041 { 00042 generator = gsl_rng_alloc (type) ; 00043 if (seed) 00044 gsl_rng_set(generator, seed); 00045 } 00046 } |
|
Definition at line 47 of file random_generator.h. 00047 {gsl_rng_free(generator);} |
|
Definition at line 52 of file random_generator.h. 00052 {if (n) return gsl_rng_uniform_int(generator, n); else return gsl_rng_get(generator);} |
|
Definition at line 63 of file random_generator.h. 00063 { return generator;} |
|
Definition at line 62 of file random_generator.h. 00062 { return generator;} |
|
Definition at line 58 of file random_generator.h. 00058 {return gsl_rng_max(generator);} |
|
Definition at line 59 of file random_generator.h. 00059 {return gsl_rng_min(generator);} |
|
Definition at line 57 of file random_generator.h. 00057 {return gsl_rng_name(generator);} |
|
Definition at line 48 of file random_generator.h. 00048 {if (generator) gsl_rng_free(generator); generator = gsl_rng_clone(other.generator);return *this;} |
|
Definition at line 49 of file random_generator.h. 00049 {gsl_rng_set(generator, seed);} |
|
Definition at line 53 of file random_generator.h. 00053 { return gsl_rng_uniform(generator);} |
|
Definition at line 54 of file random_generator.h. 00054 { return gsl_rng_uniform_pos(generator);} |