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