ARTS
2.0.49
|
Defines the Rng random number generator class. More...
Go to the source code of this file.
Classes | |
struct | gsl_rng_type |
struct | gsl_rng |
class | Rng |
Macros | |
#define | __GSL_TYPES_H__ |
#define | GSL_VAR extern |
#define | __GSL_RNG_H__ |
#define | __BEGIN_DECLS /* empty */ |
#define | __END_DECLS /* empty */ |
#define | __GSL_ERRNO_H__ |
#define | __BEGIN_DECLS /* empty */ |
#define | __END_DECLS /* empty */ |
#define | GSL_ERROR(reason, gsl_errno) |
#define | GSL_ERROR_VAL(reason, gsl_errno, value) |
#define | GSL_ERROR_VOID(reason, gsl_errno) |
#define | GSL_ERROR_NULL(reason, gsl_errno) GSL_ERROR_VAL(reason, gsl_errno, 0) |
#define | GSL_WARNING(warning, gsl_errno) |
#define | GSL_ERROR_SELECT_2(a, b) ((a) != GSL_SUCCESS ? (a) : ((b) != GSL_SUCCESS ? (b) : GSL_SUCCESS)) |
#define | GSL_ERROR_SELECT_3(a, b, c) ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_2(b,c)) |
#define | GSL_ERROR_SELECT_4(a, b, c, d) ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_3(b,c,d)) |
#define | GSL_ERROR_SELECT_5(a, b, c, d, e) ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_4(b,c,d,e)) |
#define | GSL_STATUS_UPDATE(sp, s) do { if ((s) != GSL_SUCCESS) *(sp) = (s);} while(0) |
#define | __GSL_MESSAGE_H__ |
#define | __BEGIN_DECLS /* empty */ |
#define | __END_DECLS /* empty */ |
#define | GSL_MESSAGE_MASK 0xffffffffu /* default all messages allowed */ |
#define | GSL_MESSAGE(message, mask) |
Typedefs | |
typedef void | gsl_error_handler_t(const char *reason, const char *file, int line, int gsl_errno) |
typedef void | gsl_stream_handler_t(const char *label, const char *file, int line, const char *reason) |
Enumerations | |
enum | { GSL_SUCCESS = 0, GSL_FAILURE = -1, GSL_CONTINUE = -2, GSL_EDOM = 1, GSL_ERANGE = 2, GSL_EFAULT = 3, GSL_EINVAL = 4, GSL_EFAILED = 5, GSL_EFACTOR = 6, GSL_ESANITY = 7, GSL_ENOMEM = 8, GSL_EBADFUNC = 9, GSL_ERUNAWAY = 10, GSL_EMAXITER = 11, GSL_EZERODIV = 12, GSL_EBADTOL = 13, GSL_ETOL = 14, GSL_EUNDRFLW = 15, GSL_EOVRFLW = 16, GSL_ELOSS = 17, GSL_EROUND = 18, GSL_EBADLEN = 19, GSL_ENOTSQR = 20, GSL_ESING = 21, GSL_EDIVERGE = 22, GSL_EUNSUP = 23, GSL_EUNIMPL = 24, GSL_ECACHE = 25, GSL_ETABLE = 26, GSL_ENOPROG = 27, GSL_ENOPROGJ = 28, GSL_ETOLF = 29, GSL_ETOLX = 30, GSL_ETOLG = 31, GSL_EOF = 32 } |
enum | { GSL_MESSAGE_MASK_A = 1, GSL_MESSAGE_MASK_B = 2, GSL_MESSAGE_MASK_C = 4, GSL_MESSAGE_MASK_D = 8, GSL_MESSAGE_MASK_E = 16, GSL_MESSAGE_MASK_F = 32, GSL_MESSAGE_MASK_G = 64, GSL_MESSAGE_MASK_H = 128 } |
Functions | |
const gsl_rng_type ** | gsl_rng_types_setup (void) |
gsl_rng * | gsl_rng_alloc (const gsl_rng_type *T) |
int | gsl_rng_memcpy (gsl_rng *dest, const gsl_rng *src) |
gsl_rng * | gsl_rng_clone (const gsl_rng *r) |
void | gsl_rng_free (gsl_rng *r) |
void | gsl_rng_set (const gsl_rng *r, unsigned long int seed) |
unsigned long int | gsl_rng_max (const gsl_rng *r) |
unsigned long int | gsl_rng_min (const gsl_rng *r) |
const char * | gsl_rng_name (const gsl_rng *r) |
size_t | gsl_rng_size (const gsl_rng *r) |
void * | gsl_rng_state (const gsl_rng *r) |
void | gsl_rng_print_state (const gsl_rng *r) |
const gsl_rng_type * | gsl_rng_env_setup (void) |
unsigned long int | gsl_rng_get (const gsl_rng *r) |
double | gsl_rng_uniform (const gsl_rng *r) |
double | gsl_rng_uniform_pos (const gsl_rng *r) |
unsigned long int | gsl_rng_uniform_int (const gsl_rng *r, unsigned long int n) |
void | gsl_error (const char *reason, const char *file, int line, int gsl_errno) |
void | gsl_warning (const char *reason, const char *file, int line, int gsl_errno) |
void | gsl_stream_printf (const char *label, const char *file, int line, const char *reason) |
const char * | gsl_strerror (const int gsl_errno) |
gsl_error_handler_t * | gsl_set_error_handler (gsl_error_handler_t *new_handler) |
gsl_error_handler_t * | gsl_set_error_handler_off (void) |
gsl_stream_handler_t * | gsl_set_stream_handler (gsl_stream_handler_t *new_handler) |
FILE * | gsl_set_stream (FILE *new_stream) |
__BEGIN_DECLS void | gsl_message (const char *message, const char *file, int line, unsigned int mask) |
Defines the Rng random number generator class.
The Rng class is described at the very end of this file. The rest of the file, which describes the code that actually does the work, was obtained from the GNU Scientific Library http://www.gnu.org/software/gsl/.
The Rng class uses the gsl_rng_mt_19937 random number generator whose original implementation was copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura. Coded by Takuji Nishimura, considering the suggestions by Topher Cooper and Marc Rieffel in July-Aug. 1997, "A C-program for MT19937: Integer version (1998/4/6)"
The period of this generator is 2^{19937} - 1.
Definition in file rng.h.
#define GSL_ERROR | ( | reason, | |
gsl_errno | |||
) |
#define GSL_ERROR_NULL | ( | reason, | |
gsl_errno | |||
) | GSL_ERROR_VAL(reason, gsl_errno, 0) |
#define GSL_ERROR_SELECT_2 | ( | a, | |
b | |||
) | ((a) != GSL_SUCCESS ? (a) : ((b) != GSL_SUCCESS ? (b) : GSL_SUCCESS)) |
#define GSL_ERROR_SELECT_3 | ( | a, | |
b, | |||
c | |||
) | ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_2(b,c)) |
#define GSL_ERROR_SELECT_4 | ( | a, | |
b, | |||
c, | |||
d | |||
) | ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_3(b,c,d)) |
#define GSL_ERROR_SELECT_5 | ( | a, | |
b, | |||
c, | |||
d, | |||
e | |||
) | ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_4(b,c,d,e)) |
#define GSL_ERROR_VAL | ( | reason, | |
gsl_errno, | |||
value | |||
) |
#define GSL_ERROR_VOID | ( | reason, | |
gsl_errno | |||
) |
#define GSL_MESSAGE | ( | message, | |
mask | |||
) |
#define GSL_MESSAGE_MASK 0xffffffffu /* default all messages allowed */ |
#define GSL_STATUS_UPDATE | ( | sp, | |
s | |||
) | do { if ((s) != GSL_SUCCESS) *(sp) = (s);} while(0) |
#define GSL_WARNING | ( | warning, | |
gsl_errno | |||
) |
typedef void gsl_error_handler_t(const char *reason, const char *file, int line, int gsl_errno) |
typedef void gsl_stream_handler_t(const char *label, const char *file, int line, const char *reason) |
anonymous enum |
anonymous enum |
void gsl_error | ( | const char * | reason, |
const char * | file, | ||
int | line, | ||
int | gsl_errno | ||
) |
Definition at line 482 of file rng.cc.
References gsl_error_handler, and gsl_stream_printf().
__BEGIN_DECLS void gsl_message | ( | const char * | message, |
const char * | file, | ||
int | line, | ||
unsigned int | mask | ||
) |
gsl_rng* gsl_rng_alloc | ( | const gsl_rng_type * | T | ) |
Definition at line 541 of file rng.cc.
References GSL_ENOMEM, GSL_ERROR_VAL, gsl_rng_default_seed, gsl_rng_set(), gsl_rng_type::size, gsl_rng::state, and gsl_rng::type.
Referenced by Rng::Rng().
Definition at line 583 of file rng.cc.
References GSL_ENOMEM, GSL_ERROR_VAL, q, gsl_rng::state, and gsl_rng::type.
const gsl_rng_type* gsl_rng_env_setup | ( | void | ) |
void gsl_rng_free | ( | gsl_rng * | r | ) |
unsigned long int gsl_rng_get | ( | const gsl_rng * | r | ) |
Definition at line 618 of file rng.cc.
References gsl_rng_type::get, gsl_rng::state, and gsl_rng::type.
unsigned long int gsl_rng_max | ( | const gsl_rng * | r | ) |
Definition at line 667 of file rng.cc.
References gsl_rng_type::max, and gsl_rng::type.
Definition at line 570 of file rng.cc.
References GSL_EINVAL, GSL_ERROR, GSL_SUCCESS, gsl_rng_type::size, gsl_rng::state, and gsl_rng::type.
unsigned long int gsl_rng_min | ( | const gsl_rng * | r | ) |
Definition at line 673 of file rng.cc.
References gsl_rng_type::min, and gsl_rng::type.
const char* gsl_rng_name | ( | const gsl_rng * | r | ) |
Definition at line 679 of file rng.cc.
References gsl_rng_type::name, and gsl_rng::type.
void gsl_rng_print_state | ( | const gsl_rng * | r | ) |
Definition at line 697 of file rng.cc.
References gsl_rng_type::size, gsl_rng::state, and gsl_rng::type.
void gsl_rng_set | ( | const gsl_rng * | r, |
unsigned long int | seed | ||
) |
Definition at line 611 of file rng.cc.
References gsl_rng_type::set, gsl_rng::state, and gsl_rng::type.
Referenced by Rng::force_seed(), gsl_rng_alloc(), and Rng::seed().
size_t gsl_rng_size | ( | const gsl_rng * | r | ) |
Definition at line 685 of file rng.cc.
References gsl_rng_type::size, and gsl_rng::type.
void* gsl_rng_state | ( | const gsl_rng * | r | ) |
Definition at line 691 of file rng.cc.
References gsl_rng::state.
const gsl_rng_type** gsl_rng_types_setup | ( | void | ) |
Definition at line 328 of file rng.cc.
References ADD, gsl_rng_generator_types, and gsl_rng_mt19937.
double gsl_rng_uniform | ( | const gsl_rng * | r | ) |
Definition at line 624 of file rng.cc.
References gsl_rng_type::get_double, gsl_rng::state, and gsl_rng::type.
Referenced by Rng::draw().
unsigned long int gsl_rng_uniform_int | ( | const gsl_rng * | r, |
unsigned long int | n | ||
) |
Definition at line 643 of file rng.cc.
References gsl_rng_type::get, GSL_EINVAL, GSL_ERROR_VAL, gsl_rng_type::max, gsl_rng_type::min, gsl_rng::state, and gsl_rng::type.
double gsl_rng_uniform_pos | ( | const gsl_rng * | r | ) |
Definition at line 630 of file rng.cc.
References gsl_rng_type::get_double, gsl_rng::state, and gsl_rng::type.
gsl_error_handler_t* gsl_set_error_handler | ( | gsl_error_handler_t * | new_handler | ) |
Definition at line 497 of file rng.cc.
References gsl_error_handler.
gsl_error_handler_t* gsl_set_error_handler_off | ( | void | ) |
Definition at line 506 of file rng.cc.
References gsl_error_handler.
FILE* gsl_set_stream | ( | FILE * | new_stream | ) |
Definition at line 446 of file rng.cc.
References gsl_stream.
gsl_stream_handler_t* gsl_set_stream_handler | ( | gsl_stream_handler_t * | new_handler | ) |
Definition at line 438 of file rng.cc.
References gsl_stream_handler.
void gsl_stream_printf | ( | const char * | label, |
const char * | file, | ||
int | line, | ||
const char * | reason | ||
) |
Definition at line 421 of file rng.cc.
References gsl_stream, and gsl_stream_handler.
Referenced by gsl_error().
const char* gsl_strerror | ( | const int | gsl_errno | ) |
void gsl_warning | ( | const char * | reason, |
const char * | file, | ||
int | line, | ||
int | gsl_errno | ||
) |
GSL_VAR const gsl_rng_type* gsl_rng_borosh13 |
GSL_VAR const gsl_rng_type* gsl_rng_cmrg |
GSL_VAR const gsl_rng_type* gsl_rng_coveyou |
GSL_VAR const gsl_rng_type* gsl_rng_default |
GSL_VAR const gsl_rng_type* gsl_rng_fishman18 |
GSL_VAR const gsl_rng_type* gsl_rng_fishman20 |
GSL_VAR const gsl_rng_type* gsl_rng_fishman2x |
GSL_VAR const gsl_rng_type* gsl_rng_gfsr4 |
GSL_VAR const gsl_rng_type* gsl_rng_knuthran |
GSL_VAR const gsl_rng_type* gsl_rng_knuthran2 |
GSL_VAR const gsl_rng_type* gsl_rng_lecuyer21 |
GSL_VAR const gsl_rng_type* gsl_rng_minstd |
GSL_VAR const gsl_rng_type* gsl_rng_mrg |
GSL_VAR const gsl_rng_type* gsl_rng_mt19937 |
GSL_VAR const gsl_rng_type* gsl_rng_mt19937_1998 |
GSL_VAR const gsl_rng_type* gsl_rng_mt19937_1999 |
GSL_VAR const gsl_rng_type* gsl_rng_r250 |
GSL_VAR const gsl_rng_type* gsl_rng_ran0 |
GSL_VAR const gsl_rng_type* gsl_rng_ran1 |
GSL_VAR const gsl_rng_type* gsl_rng_ran2 |
GSL_VAR const gsl_rng_type* gsl_rng_ran3 |
GSL_VAR const gsl_rng_type* gsl_rng_rand |
GSL_VAR const gsl_rng_type* gsl_rng_rand48 |
GSL_VAR const gsl_rng_type* gsl_rng_random128_bsd |
GSL_VAR const gsl_rng_type* gsl_rng_random128_glibc2 |
GSL_VAR const gsl_rng_type* gsl_rng_random128_libc5 |
GSL_VAR const gsl_rng_type* gsl_rng_random256_bsd |
GSL_VAR const gsl_rng_type* gsl_rng_random256_glibc2 |
GSL_VAR const gsl_rng_type* gsl_rng_random256_libc5 |
GSL_VAR const gsl_rng_type* gsl_rng_random32_bsd |
GSL_VAR const gsl_rng_type* gsl_rng_random32_glibc2 |
GSL_VAR const gsl_rng_type* gsl_rng_random32_libc5 |
GSL_VAR const gsl_rng_type* gsl_rng_random64_bsd |
GSL_VAR const gsl_rng_type* gsl_rng_random64_glibc2 |
GSL_VAR const gsl_rng_type* gsl_rng_random64_libc5 |
GSL_VAR const gsl_rng_type* gsl_rng_random8_bsd |
GSL_VAR const gsl_rng_type* gsl_rng_random8_glibc2 |
GSL_VAR const gsl_rng_type* gsl_rng_random8_libc5 |
GSL_VAR const gsl_rng_type* gsl_rng_random_bsd |
GSL_VAR const gsl_rng_type* gsl_rng_random_glibc2 |
GSL_VAR const gsl_rng_type* gsl_rng_random_libc5 |
GSL_VAR const gsl_rng_type* gsl_rng_randu |
GSL_VAR const gsl_rng_type* gsl_rng_ranf |
GSL_VAR const gsl_rng_type* gsl_rng_ranlux |
GSL_VAR const gsl_rng_type* gsl_rng_ranlux389 |
GSL_VAR const gsl_rng_type* gsl_rng_ranlxd1 |
GSL_VAR const gsl_rng_type* gsl_rng_ranlxd2 |
GSL_VAR const gsl_rng_type* gsl_rng_ranlxs0 |
GSL_VAR const gsl_rng_type* gsl_rng_ranlxs1 |
GSL_VAR const gsl_rng_type* gsl_rng_ranlxs2 |
GSL_VAR const gsl_rng_type* gsl_rng_ranmar |
GSL_VAR const gsl_rng_type* gsl_rng_slatec |
GSL_VAR const gsl_rng_type* gsl_rng_taus |
GSL_VAR const gsl_rng_type* gsl_rng_taus113 |
GSL_VAR const gsl_rng_type* gsl_rng_taus2 |
GSL_VAR const gsl_rng_type* gsl_rng_transputer |
GSL_VAR const gsl_rng_type* gsl_rng_tt800 |
GSL_VAR const gsl_rng_type* gsl_rng_uni |
GSL_VAR const gsl_rng_type* gsl_rng_uni32 |
GSL_VAR const gsl_rng_type* gsl_rng_vax |
GSL_VAR const gsl_rng_type* gsl_rng_waterman14 |
GSL_VAR const gsl_rng_type* gsl_rng_zuf |