ARTS  2.0.49
rng.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2008 Cory Davis <cory@met.ed.ac.uk>
2 
3  This program is free software; you can redistribute it and/or modify it
4  under the terms of the GNU General Public License as published by the
5  Free Software Foundation; either version 2, or (at your option) any
6  later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16  USA. */
17 
18 /*===========================================================================
19  === File description
20  ===========================================================================*/
21 
42 /* gsl_types.h
43  *
44  * Copyright (C) 2001 Brian Gough
45  *
46  * This program is free software; you can redistribute it and/or modify
47  * it under the terms of the GNU General Public License as published by
48  * the Free Software Foundation; either version 2 of the License, or (at
49  * your option) any later version.
50  *
51  * This program is distributed in the hope that it will be useful, but
52  * WITHOUT ANY WARRANTY; without even the implied warranty of
53  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
54  * General Public License for more details.
55  *
56  * You should have received a copy of the GNU General Public License
57  * along with this program; if not, write to the Free Software
58  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
59  */
60 #ifndef rng_h
61 #define rng_h
62 
63 #include "messages.h"
64 #ifndef __GSL_TYPES_H__
65 #define __GSL_TYPES_H__
66 
67 #ifndef GSL_VAR
68 
69 #ifdef WIN32
70 # ifdef _DLL
71 # ifdef DLL_EXPORT
72 # define GSL_VAR __declspec(dllexport)
73 # else
74 # define GSL_VAR __declspec(dllimport)
75 # endif
76 # else
77 # define GSL_VAR extern
78 # endif
79 #else
80 # define GSL_VAR extern
81 #endif
82 
83 #endif
84 
85 #endif /* __GSL_TYPES_H__ */
86 
87 
88 
89 
90 /* rng/gsl_rng.h
91  *
92  * Copyright (C) 1996, 1997, 1998, 1999, 2000 James Theiler, Brian Gough
93  *
94  * This program is free software; you can redistribute it and/or modify
95  * it under the terms of the GNU General Public License as published by
96  * the Free Software Foundation; either version 2 of the License, or (at
97  * your option) any later version.
98  *
99  * This program is distributed in the hope that it will be useful, but
100  * WITHOUT ANY WARRANTY; without even the implied warranty of
101  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
102  * General Public License for more details.
103  *
104  * You should have received a copy of the GNU General Public License
105  * along with this program; if not, write to the Free Software
106  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
107  */
108 
109 #ifndef __GSL_RNG_H__
110 #define __GSL_RNG_H__
111 #include <cstdlib>
112 
113 #undef __BEGIN_DECLS
114 #undef __END_DECLS
115 #ifdef __cplusplus
116 # define __BEGIN_DECLS extern "C" {
117 # define __END_DECLS }
118 #else
119 # define __BEGIN_DECLS /* empty */
120 # define __END_DECLS /* empty */
121 #endif
122 
124 
125 typedef struct
126  {
127  const char *name;
128  unsigned long int max;
129  unsigned long int min;
130  size_t size;
131  void (*set) (void *state, unsigned long int seed);
132  unsigned long int (*get) (void *state);
133  double (*get_double) (void *state);
134  }
136 
137 typedef struct
138  {
140  void *state;
141  }
142 gsl_rng;
143 
144 
145 /* These structs also need to appear in default.c so you can select
146  them via the environment variable GSL_RNG_TYPE */
147 
209 
210 const gsl_rng_type ** gsl_rng_types_setup(void);
211 
213 GSL_VAR unsigned long int gsl_rng_default_seed;
214 
215 gsl_rng *gsl_rng_alloc (const gsl_rng_type * T);
216 int gsl_rng_memcpy (gsl_rng * dest, const gsl_rng * src);
217 gsl_rng *gsl_rng_clone (const gsl_rng * r);
218 
219 void gsl_rng_free (gsl_rng * r);
220 
221 void gsl_rng_set (const gsl_rng * r, unsigned long int seed);
222 unsigned long int gsl_rng_max (const gsl_rng * r);
223 unsigned long int gsl_rng_min (const gsl_rng * r);
224 const char *gsl_rng_name (const gsl_rng * r);
225 size_t gsl_rng_size (const gsl_rng * r);
226 void * gsl_rng_state (const gsl_rng * r);
227 
228 void gsl_rng_print_state (const gsl_rng * r);
229 
231 
232 unsigned long int gsl_rng_get (const gsl_rng * r);
233 double gsl_rng_uniform (const gsl_rng * r);
234 double gsl_rng_uniform_pos (const gsl_rng * r);
235 unsigned long int gsl_rng_uniform_int (const gsl_rng * r, unsigned long int n);
236 
237 
238 #ifdef HAVE_INLINE
239 extern inline unsigned long int gsl_rng_get (const gsl_rng * r);
240 
241 extern inline unsigned long int
242 gsl_rng_get (const gsl_rng * r)
243 {
244  return (r->type->get) (r->state);
245 }
246 
247 extern inline double gsl_rng_uniform (const gsl_rng * r);
248 
249 extern inline double
250 gsl_rng_uniform (const gsl_rng * r)
251 {
252  return (r->type->get_double) (r->state);
253 }
254 
255 extern inline double gsl_rng_uniform_pos (const gsl_rng * r);
256 
257 extern inline double
258 gsl_rng_uniform_pos (const gsl_rng * r)
259 {
260  double x ;
261  do
262  {
263  x = (r->type->get_double) (r->state) ;
264  }
265  while (x == 0) ;
266 
267  return x ;
268 }
269 
270 extern inline unsigned long int gsl_rng_uniform_int (const gsl_rng * r, unsigned long int n);
271 
272 extern inline unsigned long int
273 gsl_rng_uniform_int (const gsl_rng * r, unsigned long int n)
274 {
275  unsigned long int offset = r->type->min;
276  unsigned long int range = r->type->max - offset;
277  unsigned long int scale = range / n;
278  unsigned long int k;
279 
280  if (n > range)
281  {
282  GSL_ERROR_VAL ("n exceeds maximum value of generator",
283  GSL_EINVAL, 0) ;
284  }
285 
286  do
287  {
288  k = (((r->type->get) (r->state)) - offset) / scale;
289  }
290  while (k >= n);
291 
292  return k;
293 }
294 #endif /* HAVE_INLINE */
295 
297 
298 #endif /* __GSL_RNG_H__ */
299 
300 /* err/gsl_errno.h
301  *
302  * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman, Brian Gough
303  *
304  * This program is free software; you can redistribute it and/or modify
305  * it under the terms of the GNU General Public License as published by
306  * the Free Software Foundation; either version 2 of the License, or (at
307  * your option) any later version.
308  *
309  * This program is distributed in the hope that it will be useful, but
310  * WITHOUT ANY WARRANTY; without even the implied warranty of
311  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
312  * General Public License for more details.
313  *
314  * You should have received a copy of the GNU General Public License
315  * along with this program; if not, write to the Free Software
316  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
317  */
318 
319 #ifndef __GSL_ERRNO_H__
320 #define __GSL_ERRNO_H__
321 
322 #include <cstdio>
323 #include <cerrno>
324 
325 #undef __BEGIN_DECLS
326 #undef __END_DECLS
327 #ifdef __cplusplus
328 # define __BEGIN_DECLS extern "C" {
329 # define __END_DECLS }
330 #else
331 # define __BEGIN_DECLS /* empty */
332 # define __END_DECLS /* empty */
333 #endif
334 
336 
337 enum {
340  GSL_CONTINUE = -2, /* iteration has not converged */
341  GSL_EDOM = 1, /* input domain error, e.g sqrt(-1) */
342  GSL_ERANGE = 2, /* output range error, e.g. exp(1e100) */
343  GSL_EFAULT = 3, /* invalid pointer */
344  GSL_EINVAL = 4, /* invalid argument supplied by user */
345  GSL_EFAILED = 5, /* generic failure */
346  GSL_EFACTOR = 6, /* factorization failed */
347  GSL_ESANITY = 7, /* sanity check failed - shouldn't happen */
348  GSL_ENOMEM = 8, /* malloc failed */
349  GSL_EBADFUNC = 9, /* problem with user-supplied function */
350  GSL_ERUNAWAY = 10, /* iterative process is out of control */
351  GSL_EMAXITER = 11, /* exceeded max number of iterations */
352  GSL_EZERODIV = 12, /* tried to divide by zero */
353  GSL_EBADTOL = 13, /* user specified an invalid tolerance */
354  GSL_ETOL = 14, /* failed to reach the specified tolerance */
355  GSL_EUNDRFLW = 15, /* underflow */
356  GSL_EOVRFLW = 16, /* overflow */
357  GSL_ELOSS = 17, /* loss of accuracy */
358  GSL_EROUND = 18, /* failed because of roundoff error */
359  GSL_EBADLEN = 19, /* matrix, vector lengths are not conformant */
360  GSL_ENOTSQR = 20, /* matrix not square */
361  GSL_ESING = 21, /* apparent singularity detected */
362  GSL_EDIVERGE = 22, /* integral or series is divergent */
363  GSL_EUNSUP = 23, /* requested feature is not supported by the hardware */
364  GSL_EUNIMPL = 24, /* requested feature not (yet) implemented */
365  GSL_ECACHE = 25, /* cache limit exceeded */
366  GSL_ETABLE = 26, /* table limit exceeded */
367  GSL_ENOPROG = 27, /* iteration is not making progress towards solution */
368  GSL_ENOPROGJ = 28, /* jacobian evaluations are not improving the solution */
369  GSL_ETOLF = 29, /* cannot reach the specified tolerance in F */
370  GSL_ETOLX = 30, /* cannot reach the specified tolerance in X */
371  GSL_ETOLG = 31, /* cannot reach the specified tolerance in gradient */
372  GSL_EOF = 32 /* end of file */
373 } ;
374 
375 void gsl_error (const char * reason, const char * file, int line,
376  int gsl_errno);
377 
378 void gsl_warning (const char * reason, const char * file, int line,
379  int gsl_errno) ;
380 
381 void gsl_stream_printf (const char *label, const char *file,
382  int line, const char *reason);
383 
384 const char * gsl_strerror (const int gsl_errno);
385 
386 typedef void gsl_error_handler_t (const char * reason, const char * file,
387  int line, int gsl_errno);
388 
389 typedef void gsl_stream_handler_t (const char * label, const char * file,
390  int line, const char * reason);
391 
394 
397 
400 
401 FILE * gsl_set_stream (FILE * new_stream);
402 
403 /* GSL_ERROR: call the error handler, and return the error code */
404 
405 #define GSL_ERROR(reason, gsl_errno) \
406  do { \
407  gsl_error (reason, __FILE__, __LINE__, gsl_errno) ; \
408  return gsl_errno ; \
409  } while (0)
410 
411 /* GSL_ERROR_VAL: call the error handler, and return the given value */
412 
413 #define GSL_ERROR_VAL(reason, gsl_errno, value) \
414  do { \
415  gsl_error (reason, __FILE__, __LINE__, gsl_errno) ; \
416  return value ; \
417  } while (0)
418 
419 /* GSL_ERROR_VOID: call the error handler, and then return
420  (for void functions which still need to generate an error) */
421 
422 #define GSL_ERROR_VOID(reason, gsl_errno) \
423  do { \
424  gsl_error (reason, __FILE__, __LINE__, gsl_errno) ; \
425  return ; \
426  } while (0)
427 
428 /* GSL_ERROR_NULL suitable for out-of-memory conditions */
429 
430 #define GSL_ERROR_NULL(reason, gsl_errno) GSL_ERROR_VAL(reason, gsl_errno, 0)
431 
432 
433 /* GSL library code can occasionally generate warnings, which are not
434  intended to be fatal. You can compile a version of the library with
435  warnings turned off globally by defining the preprocessor constant
436  GSL_WARNINGS_OFF. This turns off the warnings, but does not disable
437  error handling in any way or turn off error messages.
438 
439  GSL_WARNING() is not intended for use in client code -- use
440  GSL_MESSAGE() instead. */
441 
442 #ifdef GSL_WARNINGS_OFF /* throw away warnings */
443 #define GSL_WARNING(warning, gsl_errno) \
444  do { } while(0)
445 #else /* output all warnings */
446 #define GSL_WARNING(warning, gsl_errno) \
447  do { \
448  gsl_warning (warning, __FILE__, __LINE__, gsl_errno) ; \
449  } while (0)
450 #endif
451 
452 /* Warnings can also be turned off at runtime by setting the variable
453  gsl_warnings_off to a non-zero value */
454 
456 
457 
458 /* Sometimes you have several status results returned from
459  * function calls and you want to combine them in some sensible
460  * way. You cannot produce a "total" status condition, but you can
461  * pick one from a set of conditions based on an implied hierarchy.
462  *
463  * In other words:
464  * you have: status_a, status_b, ...
465  * you want: status = (status_a if it is bad, or status_b if it is bad,...)
466  *
467  * In this example you consider status_a to be more important and
468  * it is checked first, followed by the others in the order specified.
469  *
470  * Here are some dumb macros to do this.
471  */
472 #define GSL_ERROR_SELECT_2(a,b) ((a) != GSL_SUCCESS ? (a) : ((b) != GSL_SUCCESS ? (b) : GSL_SUCCESS))
473 #define GSL_ERROR_SELECT_3(a,b,c) ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_2(b,c))
474 #define GSL_ERROR_SELECT_4(a,b,c,d) ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_3(b,c,d))
475 #define GSL_ERROR_SELECT_5(a,b,c,d,e) ((a) != GSL_SUCCESS ? (a) : GSL_ERROR_SELECT_4(b,c,d,e))
476 
477 #define GSL_STATUS_UPDATE(sp, s) do { if ((s) != GSL_SUCCESS) *(sp) = (s);} while(0)
478 
480 
481 #endif /* __GSL_ERRNO_H__ */
482 
483 /* err/gsl_message.h
484  *
485  * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman, Brian Gough
486  *
487  * This program is free software; you can redistribute it and/or modify
488  * it under the terms of the GNU General Public License as published by
489  * the Free Software Foundation; either version 2 of the License, or (at
490  * your option) any later version.
491  *
492  * This program is distributed in the hope that it will be useful, but
493  * WITHOUT ANY WARRANTY; without even the implied warranty of
494  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
495  * General Public License for more details.
496  *
497  * You should have received a copy of the GNU General Public License
498  * along with this program; if not, write to the Free Software
499  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
500  */
501 
502 #ifndef __GSL_MESSAGE_H__
503 #define __GSL_MESSAGE_H__
504 
505 #undef __BEGIN_DECLS
506 #undef __END_DECLS
507 #ifdef __cplusplus
508 # define __BEGIN_DECLS extern "C" {
509 # define __END_DECLS }
510 #else
511 # define __BEGIN_DECLS /* empty */
512 # define __END_DECLS /* empty */
513 #endif
514 
516 
517 /* Provide a general messaging service for client use. Messages can
518  * be selectively turned off at compile time by defining an
519  * appropriate message mask. Client code which uses the GSL_MESSAGE()
520  * macro must provide a mask which is or'ed with the GSL_MESSAGE_MASK.
521  *
522  * The messaging service can be completely turned off
523  * by defining GSL_MESSAGING_OFF. */
524 
525 void gsl_message(const char * message, const char * file, int line,
526  unsigned int mask);
527 
528 #ifndef GSL_MESSAGE_MASK
529 #define GSL_MESSAGE_MASK 0xffffffffu /* default all messages allowed */
530 #endif
531 
532 GSL_VAR unsigned int gsl_message_mask ;
533 
534 /* Provide some symolic masks for client ease of use. */
535 
536 enum {
544  GSL_MESSAGE_MASK_H = 128
545 } ;
546 
547 #ifdef GSL_MESSAGING_OFF /* throw away messages */
548 #define GSL_MESSAGE(message, mask) do { } while(0)
549 #else /* output all messages */
550 #define GSL_MESSAGE(message, mask) \
551  do { \
552  if (mask & GSL_MESSAGE_MASK) \
553  gsl_message (message, __FILE__, __LINE__, mask) ; \
554  } while (0)
555 #endif
556 
558 
559 #endif /* __GSL_MESSAGE_H__ */
560 
562 
563 
564 /*CPD: 26-06-02. Here is my contribution to this file: a simple
565 random number generator class*/
566 
567 #include <ctime>
568 
569 class Rng {
570 
571  gsl_rng * r; //the gsl random number generator instance
572 
573  unsigned long int seed_no;//The integer used to seen the Rng
574 
575 
576  public:
577 
578  Rng(); //constructor
579 
580  ~Rng(); //destructor
581 
582  //The default is to seed the Rng using the seconds elapsed since
583  //1970.
584  void seed(unsigned long int n, const Verbosity& verbosity);
585 
586  void force_seed(unsigned long int n);
587 
588  double draw(); //draw a random number between [0,1)
589 
590  unsigned long int showseed() const; //return the seed.
591 };
592 
593 #endif /* rng_h */
gsl_rng_minstd
GSL_VAR const gsl_rng_type * gsl_rng_minstd
Definition: rng.h:158
gsl_rng_ran1
GSL_VAR const gsl_rng_type * gsl_rng_ran1
Definition: rng.h:165
GSL_MESSAGE_MASK_G
@ GSL_MESSAGE_MASK_G
Definition: rng.h:543
GSL_EBADTOL
@ GSL_EBADTOL
Definition: rng.h:353
GSL_EOF
@ GSL_EOF
Definition: rng.h:372
gsl_rng_ranmar
GSL_VAR const gsl_rng_type * gsl_rng_ranmar
Definition: rng.h:197
Rng::showseed
unsigned long int showseed() const
Definition: rng.cc:129
gsl_message_mask
GSL_VAR unsigned int gsl_message_mask
Definition: rng.h:532
gsl_set_stream
FILE * gsl_set_stream(FILE *new_stream)
Definition: rng.cc:446
gsl_error
void gsl_error(const char *reason, const char *file, int line, int gsl_errno)
Definition: rng.cc:482
GSL_MESSAGE_MASK_H
@ GSL_MESSAGE_MASK_H
Definition: rng.h:544
gsl_rng_fishman20
GSL_VAR const gsl_rng_type * gsl_rng_fishman20
Definition: rng.h:152
gsl_rng_random_libc5
GSL_VAR const gsl_rng_type * gsl_rng_random_libc5
Definition: rng.h:187
gsl_rng_slatec
GSL_VAR const gsl_rng_type * gsl_rng_slatec
Definition: rng.h:198
gsl_rng_ranlux
GSL_VAR const gsl_rng_type * gsl_rng_ranlux
Definition: rng.h:190
gsl_message
__BEGIN_DECLS void gsl_message(const char *message, const char *file, int line, unsigned int mask)
Rng::~Rng
~Rng()
Definition: rng.cc:61
Rng::seed_no
unsigned long int seed_no
Definition: rng.h:573
gsl_rng_vax
GSL_VAR const gsl_rng_type * gsl_rng_vax
Definition: rng.h:206
gsl_rng_borosh13
GSL_VAR const gsl_rng_type * gsl_rng_borosh13
Definition: rng.h:148
gsl_rng::type
const gsl_rng_type * type
Definition: rng.h:139
GSL_ESING
@ GSL_ESING
Definition: rng.h:361
gsl_set_stream_handler
gsl_stream_handler_t * gsl_set_stream_handler(gsl_stream_handler_t *new_handler)
Definition: rng.cc:438
gsl_rng_min
unsigned long int gsl_rng_min(const gsl_rng *r)
Definition: rng.cc:673
GSL_SUCCESS
@ GSL_SUCCESS
Definition: rng.h:338
GSL_ETABLE
@ GSL_ETABLE
Definition: rng.h:366
Rng::seed
void seed(unsigned long int n, const Verbosity &verbosity)
Definition: rng.cc:72
gsl_rng_type::get
unsigned long int(* get)(void *state)
Definition: rng.h:132
gsl_rng_max
unsigned long int gsl_rng_max(const gsl_rng *r)
Definition: rng.cc:667
gsl_rng_taus
GSL_VAR const gsl_rng_type * gsl_rng_taus
Definition: rng.h:199
GSL_EFAULT
@ GSL_EFAULT
Definition: rng.h:343
gsl_rng_default_seed
GSL_VAR unsigned long int gsl_rng_default_seed
Definition: rng.h:213
gsl_rng_ranf
GSL_VAR const gsl_rng_type * gsl_rng_ranf
Definition: rng.h:189
GSL_EDIVERGE
@ GSL_EDIVERGE
Definition: rng.h:362
GSL_ENOPROGJ
@ GSL_ENOPROGJ
Definition: rng.h:368
gsl_rng_ran0
GSL_VAR const gsl_rng_type * gsl_rng_ran0
Definition: rng.h:164
GSL_MESSAGE_MASK_A
@ GSL_MESSAGE_MASK_A
Definition: rng.h:537
gsl_rng_ranlxd1
GSL_VAR const gsl_rng_type * gsl_rng_ranlxd1
Definition: rng.h:192
gsl_rng_random32_libc5
GSL_VAR const gsl_rng_type * gsl_rng_random32_libc5
Definition: rng.h:178
GSL_FAILURE
@ GSL_FAILURE
Definition: rng.h:339
gsl_set_error_handler
gsl_error_handler_t * gsl_set_error_handler(gsl_error_handler_t *new_handler)
Definition: rng.cc:497
gsl_rng_knuthran2
GSL_VAR const gsl_rng_type * gsl_rng_knuthran2
Definition: rng.h:156
GSL_MESSAGE_MASK_B
@ GSL_MESSAGE_MASK_B
Definition: rng.h:538
GSL_ENOTSQR
@ GSL_ENOTSQR
Definition: rng.h:360
GSL_ETOLG
@ GSL_ETOLG
Definition: rng.h:371
GSL_EDOM
@ GSL_EDOM
Definition: rng.h:341
gsl_rng_random256_glibc2
GSL_VAR const gsl_rng_type * gsl_rng_random256_glibc2
Definition: rng.h:174
gsl_rng_coveyou
GSL_VAR const gsl_rng_type * gsl_rng_coveyou
Definition: rng.h:149
GSL_EMAXITER
@ GSL_EMAXITER
Definition: rng.h:351
GSL_ETOLF
@ GSL_ETOLF
Definition: rng.h:369
gsl_rng_type::get_double
double(* get_double)(void *state)
Definition: rng.h:133
gsl_rng_transputer
GSL_VAR const gsl_rng_type * gsl_rng_transputer
Definition: rng.h:202
gsl_rng_alloc
gsl_rng * gsl_rng_alloc(const gsl_rng_type *T)
Definition: rng.cc:541
gsl_rng_random8_libc5
GSL_VAR const gsl_rng_type * gsl_rng_random8_libc5
Definition: rng.h:184
GSL_ELOSS
@ GSL_ELOSS
Definition: rng.h:357
GSL_EINVAL
@ GSL_EINVAL
Definition: rng.h:344
gsl_rng_random64_bsd
GSL_VAR const gsl_rng_type * gsl_rng_random64_bsd
Definition: rng.h:179
gsl_rng_free
void gsl_rng_free(gsl_rng *r)
Definition: rng.cc:712
gsl_rng_ranlux389
GSL_VAR const gsl_rng_type * gsl_rng_ranlux389
Definition: rng.h:191
GSL_EZERODIV
@ GSL_EZERODIV
Definition: rng.h:352
Rng::draw
double draw()
Definition: rng.cc:120
gsl_rng_types_setup
const gsl_rng_type ** gsl_rng_types_setup(void)
Definition: rng.cc:328
gsl_rng_random8_bsd
GSL_VAR const gsl_rng_type * gsl_rng_random8_bsd
Definition: rng.h:182
gsl_rng_fishman18
GSL_VAR const gsl_rng_type * gsl_rng_fishman18
Definition: rng.h:151
gsl_rng::state
void * state
Definition: rng.h:140
gsl_rng_rand48
GSL_VAR const gsl_rng_type * gsl_rng_rand48
Definition: rng.h:169
gsl_rng_random8_glibc2
GSL_VAR const gsl_rng_type * gsl_rng_random8_glibc2
Definition: rng.h:183
Rng::force_seed
void force_seed(unsigned long int n)
Definition: rng.cc:110
gsl_stream_handler_t
void gsl_stream_handler_t(const char *label, const char *file, int line, const char *reason)
Definition: rng.h:389
gsl_rng_size
size_t gsl_rng_size(const gsl_rng *r)
Definition: rng.cc:685
GSL_ECACHE
@ GSL_ECACHE
Definition: rng.h:365
GSL_MESSAGE_MASK_C
@ GSL_MESSAGE_MASK_C
Definition: rng.h:539
gsl_rng_type::min
unsigned long int min
Definition: rng.h:129
gsl_rng_r250
GSL_VAR const gsl_rng_type * gsl_rng_r250
Definition: rng.h:163
gsl_rng_uniform
double gsl_rng_uniform(const gsl_rng *r)
Definition: rng.cc:624
messages.h
Declarations having to do with the four output streams.
gsl_rng_ran3
GSL_VAR const gsl_rng_type * gsl_rng_ran3
Definition: rng.h:167
gsl_rng_tt800
GSL_VAR const gsl_rng_type * gsl_rng_tt800
Definition: rng.h:203
gsl_rng_type::max
unsigned long int max
Definition: rng.h:128
gsl_rng_mt19937_1998
GSL_VAR const gsl_rng_type * gsl_rng_mt19937_1998
Definition: rng.h:162
gsl_rng_fishman2x
GSL_VAR const gsl_rng_type * gsl_rng_fishman2x
Definition: rng.h:153
gsl_rng_state
void * gsl_rng_state(const gsl_rng *r)
Definition: rng.cc:691
gsl_error_handler_t
void gsl_error_handler_t(const char *reason, const char *file, int line, int gsl_errno)
Definition: rng.h:386
gsl_rng_rand
GSL_VAR const gsl_rng_type * gsl_rng_rand
Definition: rng.h:168
gsl_rng_cmrg
GSL_VAR const gsl_rng_type * gsl_rng_cmrg
Definition: rng.h:150
GSL_ERROR_VAL
#define GSL_ERROR_VAL(reason, gsl_errno, value)
Definition: rng.h:413
gsl_rng_taus2
GSL_VAR const gsl_rng_type * gsl_rng_taus2
Definition: rng.h:200
gsl_rng_random_bsd
GSL_VAR const gsl_rng_type * gsl_rng_random_bsd
Definition: rng.h:185
gsl_rng_waterman14
GSL_VAR const gsl_rng_type * gsl_rng_waterman14
Definition: rng.h:207
gsl_warning
void gsl_warning(const char *reason, const char *file, int line, int gsl_errno)
gsl_rng_mt19937
GSL_VAR const gsl_rng_type * gsl_rng_mt19937
Definition: rng.h:160
GSL_MESSAGE_MASK_D
@ GSL_MESSAGE_MASK_D
Definition: rng.h:540
Verbosity
Definition: messages.h:50
GSL_ENOPROG
@ GSL_ENOPROG
Definition: rng.h:367
gsl_rng_type::name
const char * name
Definition: rng.h:127
gsl_rng_knuthran
GSL_VAR const gsl_rng_type * gsl_rng_knuthran
Definition: rng.h:155
GSL_MESSAGE_MASK_E
@ GSL_MESSAGE_MASK_E
Definition: rng.h:541
gsl_warnings_off
GSL_VAR int gsl_warnings_off
Definition: rng.h:455
GSL_EROUND
@ GSL_EROUND
Definition: rng.h:358
gsl_rng_lecuyer21
GSL_VAR const gsl_rng_type * gsl_rng_lecuyer21
Definition: rng.h:157
GSL_ERANGE
@ GSL_ERANGE
Definition: rng.h:342
gsl_set_error_handler_off
gsl_error_handler_t * gsl_set_error_handler_off(void)
Definition: rng.cc:506
gsl_rng_random128_bsd
GSL_VAR const gsl_rng_type * gsl_rng_random128_bsd
Definition: rng.h:170
gsl_rng_random64_glibc2
GSL_VAR const gsl_rng_type * gsl_rng_random64_glibc2
Definition: rng.h:180
gsl_rng_random256_bsd
GSL_VAR const gsl_rng_type * gsl_rng_random256_bsd
Definition: rng.h:173
gsl_rng_random128_glibc2
GSL_VAR const gsl_rng_type * gsl_rng_random128_glibc2
Definition: rng.h:171
gsl_rng_random32_glibc2
GSL_VAR const gsl_rng_type * gsl_rng_random32_glibc2
Definition: rng.h:177
GSL_EUNIMPL
@ GSL_EUNIMPL
Definition: rng.h:364
gsl_rng_ranlxs2
GSL_VAR const gsl_rng_type * gsl_rng_ranlxs2
Definition: rng.h:196
gsl_rng_randu
GSL_VAR const gsl_rng_type * gsl_rng_randu
Definition: rng.h:188
gsl_rng_random128_libc5
GSL_VAR const gsl_rng_type * gsl_rng_random128_libc5
Definition: rng.h:172
gsl_rng_ranlxd2
GSL_VAR const gsl_rng_type * gsl_rng_ranlxd2
Definition: rng.h:193
GSL_EFACTOR
@ GSL_EFACTOR
Definition: rng.h:346
Rng::Rng
Rng()
Definition: rng.cc:52
gsl_rng_set
void gsl_rng_set(const gsl_rng *r, unsigned long int seed)
Definition: rng.cc:611
GSL_EOVRFLW
@ GSL_EOVRFLW
Definition: rng.h:356
GSL_CONTINUE
@ GSL_CONTINUE
Definition: rng.h:340
GSL_MESSAGE_MASK_F
@ GSL_MESSAGE_MASK_F
Definition: rng.h:542
gsl_rng_clone
gsl_rng * gsl_rng_clone(const gsl_rng *r)
Definition: rng.cc:583
gsl_rng_ranlxs1
GSL_VAR const gsl_rng_type * gsl_rng_ranlxs1
Definition: rng.h:195
gsl_rng_taus113
GSL_VAR const gsl_rng_type * gsl_rng_taus113
Definition: rng.h:201
gsl_rng_random64_libc5
GSL_VAR const gsl_rng_type * gsl_rng_random64_libc5
Definition: rng.h:181
gsl_rng_memcpy
int gsl_rng_memcpy(gsl_rng *dest, const gsl_rng *src)
Definition: rng.cc:570
GSL_EUNDRFLW
@ GSL_EUNDRFLW
Definition: rng.h:355
Rng
Definition: rng.h:569
GSL_ENOMEM
@ GSL_ENOMEM
Definition: rng.h:348
gsl_rng_uni32
GSL_VAR const gsl_rng_type * gsl_rng_uni32
Definition: rng.h:205
__BEGIN_DECLS
#define __BEGIN_DECLS
Definition: rng.h:511
gsl_rng_name
const char * gsl_rng_name(const gsl_rng *r)
Definition: rng.cc:679
GSL_EBADFUNC
@ GSL_EBADFUNC
Definition: rng.h:349
gsl_rng_env_setup
const gsl_rng_type * gsl_rng_env_setup(void)
gsl_rng_random_glibc2
GSL_VAR const gsl_rng_type * gsl_rng_random_glibc2
Definition: rng.h:186
gsl_rng_default
GSL_VAR const gsl_rng_type * gsl_rng_default
Definition: rng.h:212
gsl_rng_uniform_int
unsigned long int gsl_rng_uniform_int(const gsl_rng *r, unsigned long int n)
Definition: rng.cc:643
GSL_ERUNAWAY
@ GSL_ERUNAWAY
Definition: rng.h:350
gsl_rng_mrg
GSL_VAR const gsl_rng_type * gsl_rng_mrg
Definition: rng.h:159
Rng::r
gsl_rng * r
Definition: rng.h:571
gsl_rng_ran2
GSL_VAR const gsl_rng_type * gsl_rng_ran2
Definition: rng.h:166
GSL_EFAILED
@ GSL_EFAILED
Definition: rng.h:345
gsl_rng_get
unsigned long int gsl_rng_get(const gsl_rng *r)
Definition: rng.cc:618
__END_DECLS
#define __END_DECLS
Definition: rng.h:512
gsl_rng_type::size
size_t size
Definition: rng.h:130
GSL_ESANITY
@ GSL_ESANITY
Definition: rng.h:347
gsl_rng_random256_libc5
GSL_VAR const gsl_rng_type * gsl_rng_random256_libc5
Definition: rng.h:175
GSL_EBADLEN
@ GSL_EBADLEN
Definition: rng.h:359
gsl_rng_type
Definition: rng.h:126
GSL_ETOLX
@ GSL_ETOLX
Definition: rng.h:370
gsl_rng_gfsr4
GSL_VAR const gsl_rng_type * gsl_rng_gfsr4
Definition: rng.h:154
GSL_ETOL
@ GSL_ETOL
Definition: rng.h:354
gsl_rng_uniform_pos
double gsl_rng_uniform_pos(const gsl_rng *r)
Definition: rng.cc:630
gsl_rng_mt19937_1999
GSL_VAR const gsl_rng_type * gsl_rng_mt19937_1999
Definition: rng.h:161
gsl_rng_uni
GSL_VAR const gsl_rng_type * gsl_rng_uni
Definition: rng.h:204
gsl_rng_random32_bsd
GSL_VAR const gsl_rng_type * gsl_rng_random32_bsd
Definition: rng.h:176
gsl_rng_ranlxs0
GSL_VAR const gsl_rng_type * gsl_rng_ranlxs0
Definition: rng.h:194
gsl_rng_zuf
GSL_VAR const gsl_rng_type * gsl_rng_zuf
Definition: rng.h:208
gsl_rng
Definition: rng.h:138
gsl_strerror
const char * gsl_strerror(const int gsl_errno)
GSL_VAR
#define GSL_VAR
Definition: rng.h:80
GSL_EUNSUP
@ GSL_EUNSUP
Definition: rng.h:363
gsl_rng_print_state
void gsl_rng_print_state(const gsl_rng *r)
Definition: rng.cc:697
gsl_stream_printf
void gsl_stream_printf(const char *label, const char *file, int line, const char *reason)
Definition: rng.cc:421