1 /** D bindings for GSL.
2     Authors:    Chibisi Chima-Okereke
3     Copyright:  Copyright (c) 2016, Chibisi Chima-Okereke. All rights reserved.
4     License:    Boost License 1.0
5 */
6 
7 module gsl.rng;
8 import gsl.errno;
9 import core.stdc.stdio : FILE;
10 import core.stdc.config : c_ulong;
11 
12 extern (C):
13 
14 struct gsl_rng_type
15 {
16     const(char)* name;
17     c_ulong max;
18     c_ulong min;
19     size_t size;
20     void function (void*, c_ulong) set;
21     c_ulong function (void*) get;
22     double function (void*) get_double;
23 }
24 
25 struct gsl_rng
26 {
27     const(gsl_rng_type)* type;
28     void* state;
29 }
30 
31 extern __gshared const(gsl_rng_type)* gsl_rng_borosh13;
32 extern __gshared const(gsl_rng_type)* gsl_rng_coveyou;
33 extern __gshared const(gsl_rng_type)* gsl_rng_cmrg;
34 extern __gshared const(gsl_rng_type)* gsl_rng_fishman18;
35 extern __gshared const(gsl_rng_type)* gsl_rng_fishman20;
36 extern __gshared const(gsl_rng_type)* gsl_rng_fishman2x;
37 extern __gshared const(gsl_rng_type)* gsl_rng_gfsr4;
38 extern __gshared const(gsl_rng_type)* gsl_rng_knuthran;
39 extern __gshared const(gsl_rng_type)* gsl_rng_knuthran2;
40 extern __gshared const(gsl_rng_type)* gsl_rng_knuthran2002;
41 extern __gshared const(gsl_rng_type)* gsl_rng_lecuyer21;
42 extern __gshared const(gsl_rng_type)* gsl_rng_minstd;
43 extern __gshared const(gsl_rng_type)* gsl_rng_mrg;
44 extern __gshared const(gsl_rng_type)* gsl_rng_mt19937;
45 extern __gshared const(gsl_rng_type)* gsl_rng_mt19937_1999;
46 extern __gshared const(gsl_rng_type)* gsl_rng_mt19937_1998;
47 extern __gshared const(gsl_rng_type)* gsl_rng_r250;
48 extern __gshared const(gsl_rng_type)* gsl_rng_ran0;
49 extern __gshared const(gsl_rng_type)* gsl_rng_ran1;
50 extern __gshared const(gsl_rng_type)* gsl_rng_ran2;
51 extern __gshared const(gsl_rng_type)* gsl_rng_ran3;
52 extern __gshared const(gsl_rng_type)* gsl_rng_rand;
53 extern __gshared const(gsl_rng_type)* gsl_rng_rand48;
54 extern __gshared const(gsl_rng_type)* gsl_rng_random128_bsd;
55 extern __gshared const(gsl_rng_type)* gsl_rng_random128_glibc2;
56 extern __gshared const(gsl_rng_type)* gsl_rng_random128_libc5;
57 extern __gshared const(gsl_rng_type)* gsl_rng_random256_bsd;
58 extern __gshared const(gsl_rng_type)* gsl_rng_random256_glibc2;
59 extern __gshared const(gsl_rng_type)* gsl_rng_random256_libc5;
60 extern __gshared const(gsl_rng_type)* gsl_rng_random32_bsd;
61 extern __gshared const(gsl_rng_type)* gsl_rng_random32_glibc2;
62 extern __gshared const(gsl_rng_type)* gsl_rng_random32_libc5;
63 extern __gshared const(gsl_rng_type)* gsl_rng_random64_bsd;
64 extern __gshared const(gsl_rng_type)* gsl_rng_random64_glibc2;
65 extern __gshared const(gsl_rng_type)* gsl_rng_random64_libc5;
66 extern __gshared const(gsl_rng_type)* gsl_rng_random8_bsd;
67 extern __gshared const(gsl_rng_type)* gsl_rng_random8_glibc2;
68 extern __gshared const(gsl_rng_type)* gsl_rng_random8_libc5;
69 extern __gshared const(gsl_rng_type)* gsl_rng_random_bsd;
70 extern __gshared const(gsl_rng_type)* gsl_rng_random_glibc2;
71 extern __gshared const(gsl_rng_type)* gsl_rng_random_libc5;
72 extern __gshared const(gsl_rng_type)* gsl_rng_randu;
73 extern __gshared const(gsl_rng_type)* gsl_rng_ranf;
74 extern __gshared const(gsl_rng_type)* gsl_rng_ranlux;
75 extern __gshared const(gsl_rng_type)* gsl_rng_ranlux389;
76 extern __gshared const(gsl_rng_type)* gsl_rng_ranlxd1;
77 extern __gshared const(gsl_rng_type)* gsl_rng_ranlxd2;
78 extern __gshared const(gsl_rng_type)* gsl_rng_ranlxs0;
79 extern __gshared const(gsl_rng_type)* gsl_rng_ranlxs1;
80 extern __gshared const(gsl_rng_type)* gsl_rng_ranlxs2;
81 extern __gshared const(gsl_rng_type)* gsl_rng_ranmar;
82 extern __gshared const(gsl_rng_type)* gsl_rng_slatec;
83 extern __gshared const(gsl_rng_type)* gsl_rng_taus;
84 extern __gshared const(gsl_rng_type)* gsl_rng_taus2;
85 extern __gshared const(gsl_rng_type)* gsl_rng_taus113;
86 extern __gshared const(gsl_rng_type)* gsl_rng_transputer;
87 extern __gshared const(gsl_rng_type)* gsl_rng_tt800;
88 extern __gshared const(gsl_rng_type)* gsl_rng_uni;
89 extern __gshared const(gsl_rng_type)* gsl_rng_uni32;
90 extern __gshared const(gsl_rng_type)* gsl_rng_vax;
91 extern __gshared const(gsl_rng_type)* gsl_rng_waterman14;
92 extern __gshared const(gsl_rng_type)* gsl_rng_zuf;
93 extern __gshared const(gsl_rng_type)* gsl_rng_default;
94 extern __gshared c_ulong gsl_rng_default_seed;
95 
96 const(gsl_rng_type*)* gsl_rng_types_setup ();
97 gsl_rng* gsl_rng_alloc (const(gsl_rng_type)* T);
98 int gsl_rng_memcpy (gsl_rng* dest, const(gsl_rng)* src);
99 gsl_rng* gsl_rng_clone (const(gsl_rng)* r);
100 void gsl_rng_free (gsl_rng* r);
101 void gsl_rng_set (const(gsl_rng)* r, c_ulong seed);
102 c_ulong gsl_rng_max (const(gsl_rng)* r);
103 c_ulong gsl_rng_min (const(gsl_rng)* r);
104 const(char)* gsl_rng_name (const(gsl_rng)* r);
105 int gsl_rng_fread (FILE* stream, gsl_rng* r);
106 int gsl_rng_fwrite (FILE* stream, const(gsl_rng)* r);
107 size_t gsl_rng_size (const(gsl_rng)* r);
108 void* gsl_rng_state (const(gsl_rng)* r);
109 void gsl_rng_print_state (const(gsl_rng)* r);
110 const(gsl_rng_type)* gsl_rng_env_setup ();
111 c_ulong gsl_rng_get (const(gsl_rng)* r);
112 double gsl_rng_uniform (const(gsl_rng)* r);
113 double gsl_rng_uniform_pos (const(gsl_rng)* r);
114 c_ulong gsl_rng_uniform_int (const(gsl_rng)* r, c_ulong n);