KJB
|
Basic RAII wrapper for GNU GSL random number generators. More...
#include <gsl_rng.h>
Public Member Functions | |
Gsl_rng_basic (const gsl_rng_type *type) | |
ctor defines type – not meant to be called directly by users. More... | |
Gsl_rng_basic (const Gsl_rng_basic< KIND > &rng) | |
copy ctor of an RNG of the same kind More... | |
Gsl_rng_basic< KIND > & | operator= (const Gsl_rng_basic< KIND > &that) |
assignment operator from an RNG of the same kind More... | |
void | seed (unsigned long seed_val) const |
seed the generator to determine its future values More... | |
std::string | serialize () const |
take a snapshot of the generator state right now More... | |
void | deserialize (const std::string &state) const |
return generator to the state "snapshot" from serialize(). More... | |
unsigned long | get () const |
Sample uniformly distributed integers over a large range. More... | |
const char * | name () const |
return C-style string of the name of the generator algorithm. More... | |
unsigned long | max () const |
maximum possible value that get() can potentially return. More... | |
unsigned long | min () const |
minimum possible value that get() can potentially return. More... | |
double | uniform () const |
Sample uniformly distributed float in interval [0,1) More... | |
double | uniform_pos () const |
Sample uniformly distributed positive float in interval (0,1) More... | |
unsigned long | uniform_int (unsigned long end_value) const |
Sample uniformly dist. non-neg. integers less than end_value. More... | |
operator const gsl_rng * () const | |
return raw pointer to generator – needed by other GSL methods More... | |
Basic RAII wrapper for GNU GSL random number generators.
Most of the gsl functions having names with prefix "gsl_rng_" are wrapped below. The methods that are NOT wrapped are the following:
The functiosn gsl_rng_fread() and gsl_rng_fwrite() are wrapped up inside the methods serialize() and deserialize(). You should use that interface since the methods also perform the type checking that fread requires.
|
inline |
ctor defines type – not meant to be called directly by users.
|
inline |
copy ctor of an RNG of the same kind
|
inline |
return generator to the state "snapshot" from serialize().
state | Output from method serialize() from a RNG of the same type as this one. |
KJB_error | corresponding to GSL_EFAILED if input is from an invalid string. |
|
inline |
|
inline |
maximum possible value that get() can potentially return.
|
inline |
minimum possible value that get() can potentially return.
|
inline |
return C-style string of the name of the generator algorithm.
|
inline |
return raw pointer to generator – needed by other GSL methods
|
inline |
assignment operator from an RNG of the same kind
|
inline |
seed the generator to determine its future values
|
inline |
take a snapshot of the generator state right now
|
inline |
Sample uniformly distributed float in interval [0,1)
|
inline |
Sample uniformly dist. non-neg. integers less than end_value.
KJB_error | corresponding to GSL_EINVAL if end_value is invalid. |
|
inline |
Sample uniformly distributed positive float in interval (0,1)