Go to the documentation of this file.
60 #ifndef __GSL_TYPES_H__
61 #define __GSL_TYPES_H__
68 #define GSL_VAR __declspec(dllexport)
70 #define GSL_VAR __declspec(dllimport)
73 #define GSL_VAR extern
76 #define GSL_VAR extern
102 #ifndef __GSL_RNG_H__
103 #define __GSL_RNG_H__
109 #define __BEGIN_DECLS extern "C" {
110 #define __END_DECLS }
112 #define __BEGIN_DECLS
123 void (*set)(
void *state,
unsigned long int seed);
124 unsigned long int (*get)(
void *state);
125 double (*get_double)(
void *state);
250 unsigned long int n);
253 unsigned long int n) {
254 unsigned long int offset = r->
type->
min;
255 unsigned long int range = r->
type->
max - offset;
256 unsigned long int scale = range / n;
294 #ifndef __GSL_ERRNO_H__
295 #define __GSL_ERRNO_H__
303 #define __BEGIN_DECLS extern "C" {
304 #define __END_DECLS }
306 #define __BEGIN_DECLS
350 void gsl_error(
const char *reason,
const char *file,
int line,
int gsl_errno);
352 void gsl_warning(
const char *reason,
const char *file,
int line,
int gsl_errno);
381 #define GSL_ERROR(reason, gsl_errno) \
383 gsl_error(reason, __FILE__, __LINE__, gsl_errno); \
389 #define GSL_ERROR_VAL(reason, gsl_errno, value) \
391 gsl_error(reason, __FILE__, __LINE__, gsl_errno); \
398 #define GSL_ERROR_VOID(reason, gsl_errno) \
400 gsl_error(reason, __FILE__, __LINE__, gsl_errno); \
406 #define GSL_ERROR_NULL(reason, gsl_errno) GSL_ERROR_VAL(reason, gsl_errno, 0)
417 #ifdef GSL_WARNINGS_OFF
418 #define GSL_WARNING(warning, gsl_errno) \
422 #define GSL_WARNING(warning, gsl_errno) \
424 gsl_warning(warning, __FILE__, __LINE__, gsl_errno); \
447 #define GSL_ERROR_SELECT_2(a, b) \
448 ((a) != GSL_SUCCESS ? (a) : ((b) != GSL_SUCCESS ? (b) : GSL_SUCCESS))
449 #define GSL_ERROR_SELECT_3(a, b, c) \
450 ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_2(b, c))
451 #define GSL_ERROR_SELECT_4(a, b, c, d) \
452 ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_3(b, c, d))
453 #define GSL_ERROR_SELECT_5(a, b, c, d, e) \
454 ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_4(b, c, d, e))
456 #define GSL_STATUS_UPDATE(sp, s) \
458 if ((s) != GSL_SUCCESS) *(sp) = (s); \
484 #ifndef __GSL_MESSAGE_H__
485 #define __GSL_MESSAGE_H__
490 #define __BEGIN_DECLS extern "C" {
491 #define __END_DECLS }
493 #define __BEGIN_DECLS
512 #ifndef GSL_MESSAGE_MASK
513 #define GSL_MESSAGE_MASK 0xffffffffu
531 #ifdef GSL_MESSAGING_OFF
532 #define GSL_MESSAGE(message, mask) \
536 #define GSL_MESSAGE(message, mask) \
538 if (mask & GSL_MESSAGE_MASK) \
539 gsl_message(message, __FILE__, __LINE__, mask); \
GSL_VAR const gsl_rng_type * gsl_rng_minstd
GSL_VAR const gsl_rng_type * gsl_rng_ran1
GSL_VAR const gsl_rng_type * gsl_rng_ranmar
unsigned long int showseed() const
Returns the seed number.
GSL_VAR unsigned int gsl_message_mask
FILE * gsl_set_stream(FILE *new_stream)
void gsl_error(const char *reason, const char *file, int line, int gsl_errno)
GSL_VAR const gsl_rng_type * gsl_rng_fishman20
GSL_VAR const gsl_rng_type * gsl_rng_random_libc5
GSL_VAR const gsl_rng_type * gsl_rng_slatec
GSL_VAR const gsl_rng_type * gsl_rng_ranlux
__BEGIN_DECLS void gsl_message(const char *message, const char *file, int line, unsigned int mask)
~Rng()
Destructor frees memory allocated to gsl_rng.
unsigned long int seed_no
GSL_VAR const gsl_rng_type * gsl_rng_vax
GSL_VAR const gsl_rng_type * gsl_rng_borosh13
const gsl_rng_type * type
gsl_stream_handler_t * gsl_set_stream_handler(gsl_stream_handler_t *new_handler)
Verbosity verbosity(Workspace &ws) noexcept
unsigned long int gsl_rng_min(const gsl_rng *r)
void seed(unsigned long int n, const Verbosity &verbosity)
Seeds the Rng with the integer argument.
unsigned long int(* get)(void *state)
unsigned long int gsl_rng_max(const gsl_rng *r)
GSL_VAR const gsl_rng_type * gsl_rng_taus
GSL_VAR unsigned long int gsl_rng_default_seed
GSL_VAR const gsl_rng_type * gsl_rng_ranf
GSL_VAR const gsl_rng_type * gsl_rng_ran0
GSL_VAR const gsl_rng_type * gsl_rng_ranlxd1
GSL_VAR const gsl_rng_type * gsl_rng_random32_libc5
gsl_error_handler_t * gsl_set_error_handler(gsl_error_handler_t *new_handler)
GSL_VAR const gsl_rng_type * gsl_rng_knuthran2
GSL_VAR const gsl_rng_type * gsl_rng_random256_glibc2
GSL_VAR const gsl_rng_type * gsl_rng_coveyou
double(* get_double)(void *state)
GSL_VAR const gsl_rng_type * gsl_rng_transputer
gsl_rng * gsl_rng_alloc(const gsl_rng_type *T)
GSL_VAR const gsl_rng_type * gsl_rng_random8_libc5
GSL_VAR const gsl_rng_type * gsl_rng_random64_bsd
void gsl_rng_free(gsl_rng *r)
GSL_VAR const gsl_rng_type * gsl_rng_ranlux389
double draw()
Draws a double from the uniform distribution [0,1)
const gsl_rng_type ** gsl_rng_types_setup(void)
GSL_VAR const gsl_rng_type * gsl_rng_random8_bsd
GSL_VAR const gsl_rng_type * gsl_rng_fishman18
GSL_VAR const gsl_rng_type * gsl_rng_rand48
GSL_VAR const gsl_rng_type * gsl_rng_random8_glibc2
void force_seed(unsigned long int n)
Seeds the Rng with the integer argument.
void gsl_stream_handler_t(const char *label, const char *file, int line, const char *reason)
size_t gsl_rng_size(const gsl_rng *r)
GSL_VAR const gsl_rng_type * gsl_rng_r250
double gsl_rng_uniform(const gsl_rng *r)
Declarations having to do with the four output streams.
GSL_VAR const gsl_rng_type * gsl_rng_ran3
GSL_VAR const gsl_rng_type * gsl_rng_tt800
GSL_VAR const gsl_rng_type * gsl_rng_mt19937_1998
GSL_VAR const gsl_rng_type * gsl_rng_fishman2x
void * gsl_rng_state(const gsl_rng *r)
void gsl_error_handler_t(const char *reason, const char *file, int line, int gsl_errno)
GSL_VAR const gsl_rng_type * gsl_rng_rand
GSL_VAR const gsl_rng_type * gsl_rng_cmrg
#define GSL_ERROR_VAL(reason, gsl_errno, value)
GSL_VAR const gsl_rng_type * gsl_rng_taus2
GSL_VAR const gsl_rng_type * gsl_rng_random_bsd
GSL_VAR const gsl_rng_type * gsl_rng_waterman14
void gsl_warning(const char *reason, const char *file, int line, int gsl_errno)
GSL_VAR const gsl_rng_type * gsl_rng_mt19937
GSL_VAR const gsl_rng_type * gsl_rng_knuthran
GSL_VAR int gsl_warnings_off
GSL_VAR const gsl_rng_type * gsl_rng_lecuyer21
gsl_error_handler_t * gsl_set_error_handler_off(void)
GSL_VAR const gsl_rng_type * gsl_rng_random128_bsd
GSL_VAR const gsl_rng_type * gsl_rng_random64_glibc2
GSL_VAR const gsl_rng_type * gsl_rng_random256_bsd
GSL_VAR const gsl_rng_type * gsl_rng_random128_glibc2
GSL_VAR const gsl_rng_type * gsl_rng_random32_glibc2
GSL_VAR const gsl_rng_type * gsl_rng_ranlxs2
GSL_VAR const gsl_rng_type * gsl_rng_randu
GSL_VAR const gsl_rng_type * gsl_rng_random128_libc5
GSL_VAR const gsl_rng_type * gsl_rng_ranlxd2
Rng()
Constructor creates instance of gsl_rng of type gsl_rng_mt19937.
void gsl_rng_set(const gsl_rng *r, unsigned long int seed)
gsl_rng * gsl_rng_clone(const gsl_rng *r)
GSL_VAR const gsl_rng_type * gsl_rng_ranlxs1
GSL_VAR const gsl_rng_type * gsl_rng_taus113
GSL_VAR const gsl_rng_type * gsl_rng_random64_libc5
int gsl_rng_memcpy(gsl_rng *dest, const gsl_rng *src)
GSL_VAR const gsl_rng_type * gsl_rng_uni32
const char * gsl_rng_name(const gsl_rng *r)
const gsl_rng_type * gsl_rng_env_setup(void)
GSL_VAR const gsl_rng_type * gsl_rng_random_glibc2
GSL_VAR const gsl_rng_type * gsl_rng_default
unsigned long int gsl_rng_uniform_int(const gsl_rng *r, unsigned long int n)
GSL_VAR const gsl_rng_type * gsl_rng_mrg
GSL_VAR const gsl_rng_type * gsl_rng_ran2
unsigned long int gsl_rng_get(const gsl_rng *r)
Vector x(Workspace &ws) noexcept
GSL_VAR const gsl_rng_type * gsl_rng_random256_libc5
GSL_VAR const gsl_rng_type * gsl_rng_gfsr4
double gsl_rng_uniform_pos(const gsl_rng *r)
GSL_VAR const gsl_rng_type * gsl_rng_mt19937_1999
GSL_VAR const gsl_rng_type * gsl_rng_uni
GSL_VAR const gsl_rng_type * gsl_rng_random32_bsd
GSL_VAR const gsl_rng_type * gsl_rng_ranlxs0
GSL_VAR const gsl_rng_type * gsl_rng_zuf
const char * gsl_strerror(const int gsl_errno)
void gsl_rng_print_state(const gsl_rng *r)
void gsl_stream_printf(const char *label, const char *file, int line, const char *reason)