-
Notifications
You must be signed in to change notification settings - Fork 0
/
al___random_8hpp_source.html
572 lines (570 loc) · 88.7 KB
/
al___random_8hpp_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Allolib: al_Random.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Allolib
 <span id="projectnumber">1.0</span>
</div>
<div id="projectbrief">C++ Components For Interactive Multimedia</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('al___random_8hpp_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">al_Random.hpp</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="preprocessor">#ifndef INCLUDE_AL_UTIL_MATH_RANDOM_HPP</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#define INCLUDE_AL_UTIL_MATH_RANDOM_HPP</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>  </div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">/* Allocore --</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> Multimedia / virtual environment application class library</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"></span> </div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> Copyright (C) 2009. AlloSphere Research Group, Media Arts & Technology, UCSB.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> Copyright (C) 2012. The Regents of the University of California.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> All rights reserved.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"></span> </div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> modification, are permitted provided that the following conditions are met:</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"></span> </div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> Redistributions of source code must retain the above copyright notice,</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> this list of conditions and the following disclaimer.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"></span> </div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> Redistributions in binary form must reproduce the above copyright</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> notice, this list of conditions and the following disclaimer in the</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> documentation and/or other materials provided with the distribution.</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"></span> </div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> Neither the name of the University of California nor the names of its</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> contributors may be used to endorse or promote products derived from</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> this software without specific prior written permission.</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"></span> </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment"> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment"> ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment"> LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment"> CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment"> SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment"> INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment"> CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment"> ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment"> POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment"></span> </div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment"></span> </div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"> File description:</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment"> Various flavors of pseudo-random number generators and distributions</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment"></span> </div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment"> File author(s):</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment"> Lance Putnam, 2006, [email protected]</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">*/</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  </div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="preprocessor">#include "al/math/al_StdRandom.hpp"</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  </div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="comment">/* req'd for int to float conversion */</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="preprocessor">#include <time.h></span> <span class="comment">/* req'd for time() */</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  </div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="preprocessor">#include <cmath></span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="preprocessor">#include <random></span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  </div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="preprocessor">#include "al/math/al_Constants.hpp"</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="preprocessor">#include "al/types/al_Conversion.hpp"</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  </div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="keyword">namespace </span><a class="code" href="namespaceal.html">al</a> {</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  </div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="namespaceal_1_1rnd.html"> 59</a></span> <span class="keyword">namespace </span>rnd {</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  </div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="keyword">class </span><a class="code" href="classal_1_1rnd_1_1_lin_con.html">LinCon</a>;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="keyword">class </span><a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html">MulLinCon</a>;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="keyword">class </span><a class="code" href="classal_1_1rnd_1_1_tausworthe.html">Tausworthe</a>;</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="keyword">template</span> <<span class="keyword">class</span> RNG></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="keyword">class </span><a class="code" href="classal_1_1rnd_1_1_random.html">Random</a>;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  </div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="keyword">inline</span> <span class="keyword">static</span> uint32_t seed() {</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="keyword">static</span> uint32_t val = time(NULL);</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordflow">return</span> val = val * 1664525UL + 1013904223UL;</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> }</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="keyword">template</span> <<span class="keyword">class</span> RNG = al::rnd::Tausworthe></div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html"> 77</a></span> <span class="keyword">class </span><a class="code" href="classal_1_1rnd_1_1_random.html">Random</a> {</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#ae09f815153a39382382f192cd854a6e9"> 80</a></span>  <a class="code" href="classal_1_1rnd_1_1_random.html#ae09f815153a39382382f192cd854a6e9">Random</a>() {}</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  </div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#a4c6ce0b44042d53ced4bef5c68aa6638"> 83</a></span>  <a class="code" href="classal_1_1rnd_1_1_random.html#a4c6ce0b44042d53ced4bef5c68aa6638">Random</a>(uint32_t <a class="code" href="classal_1_1rnd_1_1_random.html#a2cbcd06394df7baf0931a3c4b1959d2b">seed</a>) : mRNG(<a class="code" href="classal_1_1rnd_1_1_random.html#a2cbcd06394df7baf0931a3c4b1959d2b">seed</a>) {}</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  </div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#a2cbcd06394df7baf0931a3c4b1959d2b"> 86</a></span>  <a class="code" href="classal_1_1rnd_1_1_random.html">Random</a>& <a class="code" href="classal_1_1rnd_1_1_random.html#a2cbcd06394df7baf0931a3c4b1959d2b">seed</a>(uint32_t v) {</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  mRNG.seed(v);</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  }</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  </div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#a92f472555f58d0bd6751f085bce65eea"> 92</a></span>  RNG& <a class="code" href="classal_1_1rnd_1_1_random.html#a92f472555f58d0bd6751f085bce65eea">rng</a>() { <span class="keywordflow">return</span> mRNG; }</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  </div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#ad8130a3fd11ecb4e2c74ce9518ed7d1f"> 95</a></span>  <span class="keywordtype">float</span> <a class="code" href="classal_1_1rnd_1_1_random.html#ad8130a3fd11ecb4e2c74ce9518ed7d1f">uniform</a>() { <span class="keywordflow">return</span> al::uintToUnit<float>(mRNG()); }</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  </div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#aaf55963e0a215d9a4547bf3d1fece2d2"> 99</a></span>  T <a class="code" href="classal_1_1rnd_1_1_random.html#aaf55963e0a215d9a4547bf3d1fece2d2">uniform</a>(<span class="keyword">const</span> T& hi) {</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keywordflow">return</span> hi * <a class="code" href="classal_1_1rnd_1_1_random.html#ad8130a3fd11ecb4e2c74ce9518ed7d1f">uniform</a>();</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  }</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  </div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#ab77ffe6ddb5585fcc974277307eeb4be"> 105</a></span>  T <a class="code" href="classal_1_1rnd_1_1_random.html#ab77ffe6ddb5585fcc974277307eeb4be">uniform</a>(<span class="keyword">const</span> T& hi, <span class="keyword">const</span> T& lo) {</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">return</span> T((hi - lo) * <a class="code" href="classal_1_1rnd_1_1_random.html#ad8130a3fd11ecb4e2c74ce9518ed7d1f">uniform</a>()) + lo;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  }</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  </div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#abdc9398ca9eacec4b3352bbe8ac929cb"> 110</a></span>  <span class="keywordtype">float</span> <a class="code" href="classal_1_1rnd_1_1_random.html#abdc9398ca9eacec4b3352bbe8ac929cb">uniformS</a>() { <span class="keywordflow">return</span> al::uintToUnitS<float>(mRNG()); }</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  </div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#ad4c1b2b2d802557f74ed85f87f5cf9d5"> 114</a></span>  T <a class="code" href="classal_1_1rnd_1_1_random.html#ad4c1b2b2d802557f74ed85f87f5cf9d5">uniformS</a>(<span class="keyword">const</span> T& lim) {</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keywordflow">return</span> lim * <a class="code" href="classal_1_1rnd_1_1_random.html#abdc9398ca9eacec4b3352bbe8ac929cb">uniformS</a>();</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  }</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  </div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keyword">template</span> <<span class="keywordtype">int</span> N, <span class="keyword">class</span> T></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_random.html#aaec7634ec15a3a39bb663dbe5d7e1229">ball</a>(T* point);</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  </div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keyword">template</span> <<span class="keyword">template</span> <<span class="keywordtype">int</span>, <span class="keyword">class</span>> <span class="keyword">class </span>VecType, <span class="keywordtype">int</span> N, <span class="keyword">class </span>T></div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#aa4150e05d9dc8c8011b5a6713b050617"> 128</a></span>  <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_random.html#aa4150e05d9dc8c8011b5a6713b050617">ball</a>(VecType<N, T>& point) {</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  ball<N>(&point[0]);</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  }</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  </div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keyword">template</span> <<span class="keyword">class</span> VecType></div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#aaec7634ec15a3a39bb663dbe5d7e1229"> 134</a></span>  VecType <a class="code" href="classal_1_1rnd_1_1_random.html#aaec7634ec15a3a39bb663dbe5d7e1229">ball</a>() {</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  VecType v;</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <a class="code" href="classal_1_1rnd_1_1_random.html#aaec7634ec15a3a39bb663dbe5d7e1229">ball</a>(v);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">return</span> v;</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  }</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  </div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#a01b2a6a4fcf54e4f1b94f30af24a3af0"> 141</a></span>  <span class="keywordtype">float</span> <a class="code" href="classal_1_1rnd_1_1_random.html#a01b2a6a4fcf54e4f1b94f30af24a3af0">normal</a>() {</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keywordtype">float</span> r;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <a class="code" href="classal_1_1rnd_1_1_random.html#a01b2a6a4fcf54e4f1b94f30af24a3af0">normal</a>(r, r);</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="keywordflow">return</span> r;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  }</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  </div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_random.html#a01b2a6a4fcf54e4f1b94f30af24a3af0">normal</a>(T& y1, T& y2);</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  </div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keywordtype">float</span> <a class="code" href="classal_1_1rnd_1_1_random.html#a70427906050235e816f3694eabaed6c7">triangle</a>();</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  </div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#ae8ef6364412bac2cde94814751960284"> 156</a></span>  T <a class="code" href="classal_1_1rnd_1_1_random.html#ae8ef6364412bac2cde94814751960284">triangle</a>(<span class="keyword">const</span> T& hi) {</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keywordflow">return</span> hi * <a class="code" href="classal_1_1rnd_1_1_random.html#a70427906050235e816f3694eabaed6c7">triangle</a>();</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  }</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  </div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordtype">float</span> <a class="code" href="classal_1_1rnd_1_1_random.html#ac984eb9c0caece85dc10c8ab90870ec1">sign</a>(<span class="keywordtype">float</span> x = 1.f);</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  </div>
<div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#a59ad0f54afdb6fab5e5f5bfdc076bf09"> 164</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classal_1_1rnd_1_1_random.html#a59ad0f54afdb6fab5e5f5bfdc076bf09">prob</a>() { <span class="keywordflow">return</span> mRNG() & 0x80000000; }</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  </div>
<div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#afc43b4e498076d91d119e3b118cc1552"> 167</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classal_1_1rnd_1_1_random.html#afc43b4e498076d91d119e3b118cc1552">prob</a>(<span class="keywordtype">float</span> p) { <span class="keywordflow">return</span> <a class="code" href="classal_1_1rnd_1_1_random.html#ad8130a3fd11ecb4e2c74ce9518ed7d1f">uniform</a>() < p; }</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  </div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_random.html#acd32211ca381c5a9a46ac4d2ae7dda85">shuffle</a>(T* arr, uint32_t len);</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  </div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="comment">// DEPRECATED:</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordtype">float</span> gaussian() { <span class="keywordflow">return</span> <a class="code" href="classal_1_1rnd_1_1_random.html#a01b2a6a4fcf54e4f1b94f30af24a3af0">normal</a>(); }</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keywordtype">void</span> gaussian(T& y1, T& y2) {</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <a class="code" href="classal_1_1rnd_1_1_random.html#a01b2a6a4fcf54e4f1b94f30af24a3af0">normal</a>(y1, y2);</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  }</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  </div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  RNG mRNG;</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span> };</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  </div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  </div>
<div class="line"><a name="l00195"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_lin_con.html"> 195</a></span> <span class="keyword">class </span><a class="code" href="classal_1_1rnd_1_1_lin_con.html">LinCon</a> {</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00198"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_lin_con.html#a748eab4e5f473855d8a709a69ac1b7b1"> 198</a></span>  <a class="code" href="classal_1_1rnd_1_1_lin_con.html#a748eab4e5f473855d8a709a69ac1b7b1">LinCon</a>() {</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <a class="code" href="classal_1_1rnd_1_1_lin_con.html#a7e9175742b610a27b4f57706111454c5">seed</a>(al::rnd::seed());</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <a class="code" href="classal_1_1rnd_1_1_lin_con.html#a9dc1493f473290e29da367b568b5bffe">type</a>(0);</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  }</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  </div>
<div class="line"><a name="l00204"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_lin_con.html#af128419e2138bdadee5d033a4c90d1f8"> 204</a></span>  <a class="code" href="classal_1_1rnd_1_1_lin_con.html#af128419e2138bdadee5d033a4c90d1f8">LinCon</a>(uint32_t <a class="code" href="classal_1_1rnd_1_1_lin_con.html#a7e9175742b610a27b4f57706111454c5">seed</a>) : mVal(<a class="code" href="classal_1_1rnd_1_1_lin_con.html#a7e9175742b610a27b4f57706111454c5">seed</a>) { <a class="code" href="classal_1_1rnd_1_1_lin_con.html#a9dc1493f473290e29da367b568b5bffe">type</a>(0); }</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  </div>
<div class="line"><a name="l00207"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_lin_con.html#a04c516007817deff11f80b0775bbb436"> 207</a></span>  uint32_t <a class="code" href="classal_1_1rnd_1_1_lin_con.html#a04c516007817deff11f80b0775bbb436">operator()</a>() { <span class="keywordflow">return</span> mVal = mVal * mMul + mAdd; }</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  </div>
<div class="line"><a name="l00210"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_lin_con.html#a7e9175742b610a27b4f57706111454c5"> 210</a></span>  <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_lin_con.html#a7e9175742b610a27b4f57706111454c5">seed</a>(uint32_t v) { mVal = v; }</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  </div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  </div>
<div class="line"><a name="l00216"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_lin_con.html#a9dc1493f473290e29da367b568b5bffe"> 216</a></span>  <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_lin_con.html#a9dc1493f473290e29da367b568b5bffe">type</a>(<span class="keywordtype">int</span> v) {</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="keywordflow">switch</span> (v) {</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordflow">case</span> 0:</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  mMul = 1664525;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  mAdd = 1013904223;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="keywordflow">case</span> 1:</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  mMul = 2147001325;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  mAdd = 715136305;</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  }</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  }</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  </div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  uint32_t mVal;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  uint32_t mMul, mAdd;</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span> };</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  </div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  </div>
<div class="line"><a name="l00244"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_mul_lin_con.html"> 244</a></span> <span class="keyword">class </span><a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html">MulLinCon</a> {</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00247"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_mul_lin_con.html#ac5091c376b82c28695ccc36e7fcd4475"> 247</a></span>  <a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html#ac5091c376b82c28695ccc36e7fcd4475">MulLinCon</a>() {</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html#a9e2412e5d1425b8d1b776fb5335a54af">seed</a>(al::rnd::seed());</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html#ab501647964ab76f1229ba72599248fb7">type</a>(0);</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  }</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  </div>
<div class="line"><a name="l00253"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_mul_lin_con.html#adf86d95b991ea0bdd50ea120d60cf14d"> 253</a></span>  <a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html#adf86d95b991ea0bdd50ea120d60cf14d">MulLinCon</a>(uint32_t <a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html#a9e2412e5d1425b8d1b776fb5335a54af">seed</a>) : mVal(<a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html#a9e2412e5d1425b8d1b776fb5335a54af">seed</a>) { <a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html#ab501647964ab76f1229ba72599248fb7">type</a>(0); }</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  </div>
<div class="line"><a name="l00256"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_mul_lin_con.html#a2b8af9337057f09e6dce0832546b13e3"> 256</a></span>  uint32_t <a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html#a2b8af9337057f09e6dce0832546b13e3">operator()</a>() { <span class="keywordflow">return</span> mVal *= mMul; }</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  </div>
<div class="line"><a name="l00259"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_mul_lin_con.html#a9e2412e5d1425b8d1b776fb5335a54af"> 259</a></span>  <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html#a9e2412e5d1425b8d1b776fb5335a54af">seed</a>(uint32_t v) { mVal = v; }</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  </div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  </div>
<div class="line"><a name="l00267"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_mul_lin_con.html#ab501647964ab76f1229ba72599248fb7"> 267</a></span>  <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_mul_lin_con.html#ab501647964ab76f1229ba72599248fb7">type</a>(<span class="keywordtype">int</span> v) {</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="keywordflow">switch</span> (v) {</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  mMul = 2891336453UL;</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="keywordflow">break</span>; <span class="comment">// L'Ecuyer M8</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <span class="keywordflow">case</span> 1:</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  mMul = 29943829UL;</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  <span class="keywordflow">break</span>; <span class="comment">// L'Ecuyer M16</span></div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keywordflow">case</span> 2:</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  mMul = 32310901UL;</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <span class="keywordflow">break</span>; <span class="comment">// L'Ecuyer M32</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <span class="keywordflow">case</span> 3:</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  mMul = 69069UL;</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="keywordflow">break</span>; <span class="comment">// Super-duper</span></div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  }</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  }</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  </div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  uint32_t mVal;</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  uint32_t mMul;</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span> };</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  </div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  </div>
<div class="line"><a name="l00299"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_tausworthe.html"> 299</a></span> <span class="keyword">class </span><a class="code" href="classal_1_1rnd_1_1_tausworthe.html">Tausworthe</a> {</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#a7d81888c685b9d3bbfca69af7f9c70cd">Tausworthe</a>();</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  </div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#a7d81888c685b9d3bbfca69af7f9c70cd">Tausworthe</a>(uint32_t <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#acab1f91bbb7305e77d3e78b620416bdf">seed</a>);</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  </div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  uint32_t <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#ae6f75bc27958a76423cd273dde14491e">operator()</a>();</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  </div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#acab1f91bbb7305e77d3e78b620416bdf">seed</a>(uint32_t v);</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  </div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#acab1f91bbb7305e77d3e78b620416bdf">seed</a>(uint32_t v1, uint32_t v2, uint32_t v3, uint32_t v4);</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  </div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  uint32_t s1, s2, s3, s4;</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  <span class="keywordtype">void</span> iterate();</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span> };</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  </div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span> <span class="comment">// Implementation_______________________________________________________________</span></div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  </div>
<div class="line"><a name="l00323"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_tausworthe.html#a7d81888c685b9d3bbfca69af7f9c70cd"> 323</a></span> <span class="keyword">inline</span> <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#a7d81888c685b9d3bbfca69af7f9c70cd">Tausworthe::Tausworthe</a>() { <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#acab1f91bbb7305e77d3e78b620416bdf">seed</a>(al::rnd::seed()); }</div>
<div class="line"><a name="l00324"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_tausworthe.html#a2ac7e029f8448b612e1c85550c61cba5"> 324</a></span> <span class="keyword">inline</span> <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#a7d81888c685b9d3bbfca69af7f9c70cd">Tausworthe::Tausworthe</a>(uint32_t sd) { <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#acab1f91bbb7305e77d3e78b620416bdf">seed</a>(sd); }</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  </div>
<div class="line"><a name="l00326"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_tausworthe.html#ae6f75bc27958a76423cd273dde14491e"> 326</a></span> <span class="keyword">inline</span> uint32_t <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#ae6f75bc27958a76423cd273dde14491e">Tausworthe::operator()</a>() {</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  iterate();</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <span class="keywordflow">return</span> s1 ^ s2 ^ s3 ^ s4;</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span> }</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  </div>
<div class="line"><a name="l00331"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_tausworthe.html#acab1f91bbb7305e77d3e78b620416bdf"> 331</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#acab1f91bbb7305e77d3e78b620416bdf">Tausworthe::seed</a>(uint32_t v) {</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  <a class="code" href="classal_1_1rnd_1_1_lin_con.html">al::rnd::LinCon</a> g(v);</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  g();</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#acab1f91bbb7305e77d3e78b620416bdf">seed</a>(g(), g(), g(), g());</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span> }</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  </div>
<div class="line"><a name="l00337"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_tausworthe.html#a4b375780d0bc17f3c80bb8cadf283426"> 337</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_tausworthe.html#acab1f91bbb7305e77d3e78b620416bdf">Tausworthe::seed</a>(uint32_t v1, uint32_t v2, uint32_t v3,</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  uint32_t v4) {</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <span class="comment">// printf("%u %u %u %u\n", v1, v2, v3, v4);</span></div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  v1& 0xffffffe ? s1 = v1 : s1 = ~v1;</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  v2& 0xffffff8 ? s2 = v2 : s2 = ~v2;</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  v3& 0xffffff0 ? s3 = v3 : s3 = ~v3;</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  v4& 0xfffff80 ? s4 = v4 : s4 = ~v4;</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span> }</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  </div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> Tausworthe::iterate() {</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  s1 = ((s1 & 0xfffffffe) << 18) ^ (((s1 << 6) ^ s1) >> 13);</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  s2 = ((s2 & 0xfffffff8) << 2) ^ (((s2 << 2) ^ s2) >> 27);</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  s3 = ((s3 & 0xfffffff0) << 7) ^ (((s3 << 13) ^ s3) >> 21);</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  s4 = ((s4 & 0xffffff80) << 13) ^ (((s4 << 3) ^ s4) >> 12);</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span> }</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  </div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span> <span class="keyword">template</span> <<span class="keyword">class</span> RNG></div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span> <span class="keyword">template</span> <<span class="keywordtype">int</span> N, <span class="keyword">class</span> T></div>
<div class="line"><a name="l00355"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#a3fae428fd91c50e1d38443716bcd467c"> 355</a></span> <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_random.html#aaec7634ec15a3a39bb663dbe5d7e1229">Random<RNG>::ball</a>(T* point) {</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  T w;</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  <span class="keywordflow">do</span> {</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  w = T(0);</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < N; ++i) {</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  <span class="keywordtype">float</span> v = <a class="code" href="namespaceal_1_1rnd.html#a25d395f63213c329c0f8c436c1b770cd">uniformS</a>();</div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  point[i] = v;</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  w += v * v;</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  }</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  } <span class="keywordflow">while</span> (w >= T(1)); <span class="comment">// if on or outside unit ball, try again</span></div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span> }</div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  </div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span> <span class="comment">// Box-Muller transform</span></div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span> <span class="comment">// Box, G. and Muller, M. A note on the generation of normal deviates.</span></div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span> <span class="comment">// Ann. Math. Slat. 28, (1958).</span></div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span> <span class="comment">//</span></div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span> <span class="comment">// http://en.wikipedia.org/wiki/Box-Muller_transform</span></div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span> <span class="keyword">template</span> <<span class="keyword">class</span> RNG></div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00374"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#a707b29531002a8acfd5c2168453c77a6"> 374</a></span> <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_random.html#a01b2a6a4fcf54e4f1b94f30af24a3af0">Random<RNG>::normal</a>(T& y1, T& y2) {</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  <span class="keywordtype">float</span> x1, x2, w;</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  </div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <span class="comment">// Search for point within unit circle using sample-reject.</span></div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  <span class="comment">// This will pass with probability pi/4 = ~0.785.</span></div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <span class="keywordflow">do</span> {</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  x1 = <a class="code" href="namespaceal_1_1rnd.html#a25d395f63213c329c0f8c436c1b770cd">uniformS</a>();</div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  x2 = <a class="code" href="namespaceal_1_1rnd.html#a25d395f63213c329c0f8c436c1b770cd">uniformS</a>();</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  w = x1 * x1 + x2 * x2;</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  } <span class="keywordflow">while</span> (w >= 1.f);</div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  </div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  <span class="comment">// perform inverse Gaussian function mapping</span></div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  w = std::sqrt((-2.f * std::log(w)) / w);</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  y1 = T(x1 * w);</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  y2 = T(x2 * w);</div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span> }</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  </div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span> <span class="keyword">template</span> <<span class="keyword">class</span> RNG></div>
<div class="line"><a name="l00392"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#a70427906050235e816f3694eabaed6c7"> 392</a></span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classal_1_1rnd_1_1_random.html#a70427906050235e816f3694eabaed6c7">Random<RNG>::triangle</a>() {</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  <span class="keyword">union </span>{</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  <span class="keywordtype">float</span> f;</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  uint32_t i;</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  } u, v;</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  u.i = 0x3f800000 | (mRNG() >> 9); <span class="comment">// float in [1,2)</span></div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  v.i = 0x3f800000 | (mRNG() >> 9); <span class="comment">// float in [1,2)</span></div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <span class="keywordflow">return</span> u.f - v.f;</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span> }</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  </div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span> <span class="keyword">template</span> <<span class="keyword">class</span> RNG></div>
<div class="line"><a name="l00403"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#ac984eb9c0caece85dc10c8ab90870ec1"> 403</a></span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classal_1_1rnd_1_1_random.html#ac984eb9c0caece85dc10c8ab90870ec1">Random<RNG>::sign</a>(<span class="keywordtype">float</span> x) {</div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  <span class="keyword">union </span>{</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  <span class="keywordtype">float</span> f;</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  uint32_t i;</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  } u = {x};</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  u.i |= mRNG() & 0x80000000;</div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  <span class="keywordflow">return</span> u.f;</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span> }</div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  </div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span> <span class="comment">// Fisher-Yates shuffle</span></div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span> <span class="keyword">template</span> <<span class="keyword">class</span> RNG></div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00415"></a><span class="lineno"><a class="line" href="classal_1_1rnd_1_1_random.html#acd32211ca381c5a9a46ac4d2ae7dda85"> 415</a></span> <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_random.html#acd32211ca381c5a9a46ac4d2ae7dda85">Random<RNG>::shuffle</a>(T* arr, uint32_t len) {</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  <span class="keywordflow">for</span> (uint32_t i = len - 1; i > 0; --i) {</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  uint32_t j = <a class="code" href="namespaceal_1_1rnd.html#a95b95f1416fd7a484cdbcacd470bdb23">uniform</a>(i + 1);</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  T t = arr[i];</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  arr[i] = arr[j];</div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  arr[j] = t;</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  }</div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span> }</div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  </div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span> } <span class="comment">// namespace rnd</span></div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  </div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span> <span class="comment">// for using std random class with al_Random interface</span></div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>  </div>
<div class="line"><a name="l00428"></a><span class="lineno"><a class="line" href="classal_1_1_std_rnd.html"> 428</a></span> <span class="keyword">class </span><a class="code" href="classal_1_1_std_rnd.html">StdRnd</a> {</div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  <a class="code" href="classal_1_1rand__uniformf.html">rand_uniformf</a> mUniformf;</div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  <a class="code" href="classal_1_1rand__uniformi.html">rand_uniformi</a> mUniformi;</div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  </div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  <a class="code" href="classal_1_1_std_rnd.html">StdRnd</a>() : mUniformf{} {}</div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  <a class="code" href="classal_1_1_std_rnd.html">StdRnd</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> seed) : mUniformf{seed}, mUniformi{seed} {}</div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  </div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>  <span class="comment">// [0, 1)</span></div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>  <span class="keywordtype">float</span> operator()() { <span class="keywordflow">return</span> mUniformf(); }</div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>  <span class="keywordtype">float</span> operator()(<span class="keywordtype">float</span> hi) { <span class="keywordflow">return</span> mUniformf(0, hi); }</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  <span class="keywordtype">float</span> operator()(<span class="keywordtype">float</span> lo, <span class="keywordtype">float</span> hi) { <span class="keywordflow">return</span> mUniformf(lo, hi); }</div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  </div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>  <span class="keywordtype">void</span> seed(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> s) { mUniformf.seed(s); }</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>  </div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>  <span class="keywordtype">int</span> randi(<span class="keywordtype">int</span> hi) { <span class="keywordflow">return</span> mUniformi(0, hi); }</div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>  <span class="keywordtype">int</span> randi(<span class="keywordtype">int</span> lo, <span class="keywordtype">int</span> hi) { <span class="keywordflow">return</span> mUniformi(lo, hi); }</div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>  </div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  <span class="keywordtype">void</span> seedi(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> s) { mUniformi.seed(s); }</div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span> };</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  </div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span> <span class="keyword">using</span> <a class="code" href="classal_1_1rnd_1_1_random.html">StdRandom</a> = <a class="code" href="classal_1_1rnd_1_1_random.html">al::rnd::Random<StdRnd></a>;</div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>  </div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span> <span class="keyword">namespace </span>rnd {</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>  </div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classal_1_1rnd_1_1_random.html#ad8130a3fd11ecb4e2c74ce9518ed7d1f">StdRandom::uniform</a>() {</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>  <span class="keywordflow">return</span> mRNG();</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span> }</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>  </div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span> <span class="keyword">inline</span> T <a class="code" href="classal_1_1rnd_1_1_random.html#ad8130a3fd11ecb4e2c74ce9518ed7d1f">StdRandom::uniform</a>(T <span class="keyword">const</span>& hi) {</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T<span class="keyword">></span>(mRNG(<span class="keywordtype">float</span>(hi)));</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span> }</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>  </div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span> <span class="keyword">inline</span> T <a class="code" href="classal_1_1rnd_1_1_random.html#ad8130a3fd11ecb4e2c74ce9518ed7d1f">StdRandom::uniform</a>(T <span class="keyword">const</span>& hi, T <span class="keyword">const</span>& lo) {</div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T<span class="keyword">></span>(mRNG(<span class="keywordtype">float</span>(lo), <span class="keywordtype">float</span>(hi)));</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span> }</div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>  </div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classal_1_1rnd_1_1_random.html#abdc9398ca9eacec4b3352bbe8ac929cb">StdRandom::uniformS</a>() {</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>  <span class="keywordflow">return</span> mRNG(-1.0f, 1.0f);</div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span> }</div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>  </div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span> <span class="keyword">inline</span> T <a class="code" href="classal_1_1rnd_1_1_random.html#abdc9398ca9eacec4b3352bbe8ac929cb">StdRandom::uniformS</a>(T <span class="keyword">const</span>& lim) {</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T<span class="keyword">></span>(mRNG(<span class="keywordtype">float</span>(-lim), <span class="keywordtype">float</span>(lim)));</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span> }</div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>  </div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classal_1_1rnd_1_1_random.html#a70427906050235e816f3694eabaed6c7">StdRandom::triangle</a>() {</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>  <span class="keywordflow">return</span> 0.5f * (<a class="code" href="namespaceal_1_1rnd.html#a25d395f63213c329c0f8c436c1b770cd">uniformS</a>() + <a class="code" href="namespaceal_1_1rnd.html#a25d395f63213c329c0f8c436c1b770cd">uniformS</a>());</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span> }</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>  </div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classal_1_1rnd_1_1_random.html#ac984eb9c0caece85dc10c8ab90870ec1">StdRandom::sign</a>(<span class="keywordtype">float</span> x) {</div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>  <span class="keyword">static</span> <span class="keywordtype">float</span> arr[2] = {-1.0f, 1.0f};</div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>  <span class="keywordflow">return</span> x * arr[mRNG.randi(0, 1)];</div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span> }</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>  </div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classal_1_1rnd_1_1_random.html#acd32211ca381c5a9a46ac4d2ae7dda85">StdRandom::shuffle</a>(T* arr, uint32_t len) {</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>  <span class="keywordflow">for</span> (uint32_t i = len - 1; i > 0; i -= 1) {</div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>  uint32_t j = mRNG.randi(i + 1);</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>  T t = arr[i];</div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>  arr[i] = arr[j];</div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>  arr[j] = t;</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>  }</div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span> }</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>  </div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span> } <span class="comment">// namespace rnd</span></div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>  </div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span> } <span class="comment">// namespace al</span></div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>  </div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span> <span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassal_1_1_std_rnd_html"><div class="ttname"><a href="classal_1_1_std_rnd.html">al::StdRnd</a></div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00428">al_Random.hpp:428</a></div></div>
<div class="ttc" id="aclassal_1_1rand__uniformf_html"><div class="ttname"><a href="classal_1_1rand__uniformf.html">al::rand_uniformf</a></div><div class="ttdef"><b>Definition:</b> <a href="al___std_random_8hpp_source.html#l00037">al_StdRandom.hpp:37</a></div></div>
<div class="ttc" id="aclassal_1_1rand__uniformi_html"><div class="ttname"><a href="classal_1_1rand__uniformi.html">al::rand_uniformi</a></div><div class="ttdef"><b>Definition:</b> <a href="al___std_random_8hpp_source.html#l00021">al_StdRandom.hpp:21</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_lin_con_html"><div class="ttname"><a href="classal_1_1rnd_1_1_lin_con.html">al::rnd::LinCon</a></div><div class="ttdoc">Linear congruential uniform pseudo-random number generator.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00195">al_Random.hpp:195</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_lin_con_html_a04c516007817deff11f80b0775bbb436"><div class="ttname"><a href="classal_1_1rnd_1_1_lin_con.html#a04c516007817deff11f80b0775bbb436">al::rnd::LinCon::operator()</a></div><div class="ttdeci">uint32_t operator()()</div><div class="ttdoc">Generate next uniform random integer in [0, 2^32)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00207">al_Random.hpp:207</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_lin_con_html_a748eab4e5f473855d8a709a69ac1b7b1"><div class="ttname"><a href="classal_1_1rnd_1_1_lin_con.html#a748eab4e5f473855d8a709a69ac1b7b1">al::rnd::LinCon::LinCon</a></div><div class="ttdeci">LinCon()</div><div class="ttdoc">Default constructor uses a randomly generated seed.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00198">al_Random.hpp:198</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_lin_con_html_a7e9175742b610a27b4f57706111454c5"><div class="ttname"><a href="classal_1_1rnd_1_1_lin_con.html#a7e9175742b610a27b4f57706111454c5">al::rnd::LinCon::seed</a></div><div class="ttdeci">void seed(uint32_t v)</div><div class="ttdoc">Set seed.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00210">al_Random.hpp:210</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_lin_con_html_a9dc1493f473290e29da367b568b5bffe"><div class="ttname"><a href="classal_1_1rnd_1_1_lin_con.html#a9dc1493f473290e29da367b568b5bffe">al::rnd::LinCon::type</a></div><div class="ttdeci">void type(int v)</div><div class="ttdoc">Change the type of equation used.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00216">al_Random.hpp:216</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_lin_con_html_af128419e2138bdadee5d033a4c90d1f8"><div class="ttname"><a href="classal_1_1rnd_1_1_lin_con.html#af128419e2138bdadee5d033a4c90d1f8">al::rnd::LinCon::LinCon</a></div><div class="ttdeci">LinCon(uint32_t seed)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00204">al_Random.hpp:204</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_mul_lin_con_html"><div class="ttname"><a href="classal_1_1rnd_1_1_mul_lin_con.html">al::rnd::MulLinCon</a></div><div class="ttdoc">Multiplicative linear congruential uniform pseudo-random number generator.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00244">al_Random.hpp:244</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_mul_lin_con_html_a2b8af9337057f09e6dce0832546b13e3"><div class="ttname"><a href="classal_1_1rnd_1_1_mul_lin_con.html#a2b8af9337057f09e6dce0832546b13e3">al::rnd::MulLinCon::operator()</a></div><div class="ttdeci">uint32_t operator()()</div><div class="ttdoc">Generate next uniform random integer in [0, 2^32)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00256">al_Random.hpp:256</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_mul_lin_con_html_a9e2412e5d1425b8d1b776fb5335a54af"><div class="ttname"><a href="classal_1_1rnd_1_1_mul_lin_con.html#a9e2412e5d1425b8d1b776fb5335a54af">al::rnd::MulLinCon::seed</a></div><div class="ttdeci">void seed(uint32_t v)</div><div class="ttdoc">Set seed.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00259">al_Random.hpp:259</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_mul_lin_con_html_ab501647964ab76f1229ba72599248fb7"><div class="ttname"><a href="classal_1_1rnd_1_1_mul_lin_con.html#ab501647964ab76f1229ba72599248fb7">al::rnd::MulLinCon::type</a></div><div class="ttdeci">void type(int v)</div><div class="ttdoc">Change the type of equation used.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00267">al_Random.hpp:267</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_mul_lin_con_html_ac5091c376b82c28695ccc36e7fcd4475"><div class="ttname"><a href="classal_1_1rnd_1_1_mul_lin_con.html#ac5091c376b82c28695ccc36e7fcd4475">al::rnd::MulLinCon::MulLinCon</a></div><div class="ttdeci">MulLinCon()</div><div class="ttdoc">Default constructor uses a randomly generated seed.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00247">al_Random.hpp:247</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_mul_lin_con_html_adf86d95b991ea0bdd50ea120d60cf14d"><div class="ttname"><a href="classal_1_1rnd_1_1_mul_lin_con.html#adf86d95b991ea0bdd50ea120d60cf14d">al::rnd::MulLinCon::MulLinCon</a></div><div class="ttdeci">MulLinCon(uint32_t seed)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00253">al_Random.hpp:253</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html">al::rnd::Random</a></div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00077">al_Random.hpp:77</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_a01b2a6a4fcf54e4f1b94f30af24a3af0"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#a01b2a6a4fcf54e4f1b94f30af24a3af0">al::rnd::Random::normal</a></div><div class="ttdeci">float normal()</div><div class="ttdoc">Returns standard normal variate.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00141">al_Random.hpp:141</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_a2cbcd06394df7baf0931a3c4b1959d2b"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#a2cbcd06394df7baf0931a3c4b1959d2b">al::rnd::Random::seed</a></div><div class="ttdeci">Random & seed(uint32_t v)</div><div class="ttdoc">Set seed.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00086">al_Random.hpp:86</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_a4c6ce0b44042d53ced4bef5c68aa6638"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#a4c6ce0b44042d53ced4bef5c68aa6638">al::rnd::Random::Random</a></div><div class="ttdeci">Random(uint32_t seed)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00083">al_Random.hpp:83</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_a59ad0f54afdb6fab5e5f5bfdc076bf09"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#a59ad0f54afdb6fab5e5f5bfdc076bf09">al::rnd::Random::prob</a></div><div class="ttdeci">bool prob()</div><div class="ttdoc">Returns true with a probability of 0.5.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00164">al_Random.hpp:164</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_a70427906050235e816f3694eabaed6c7"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#a70427906050235e816f3694eabaed6c7">al::rnd::Random::triangle</a></div><div class="ttdeci">float triangle()</div><div class="ttdoc">Returns triangle distribution variate, in (-1,1)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00392">al_Random.hpp:392</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_a92f472555f58d0bd6751f085bce65eea"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#a92f472555f58d0bd6751f085bce65eea">al::rnd::Random::rng</a></div><div class="ttdeci">RNG & rng()</div><div class="ttdoc">Get underlying random number generator.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00092">al_Random.hpp:92</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_aa4150e05d9dc8c8011b5a6713b050617"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#aa4150e05d9dc8c8011b5a6713b050617">al::rnd::Random::ball</a></div><div class="ttdeci">void ball(VecType< N, T > &point)</div><div class="ttdoc">Returns point within a unit ball.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00128">al_Random.hpp:128</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_aaec7634ec15a3a39bb663dbe5d7e1229"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#aaec7634ec15a3a39bb663dbe5d7e1229">al::rnd::Random::ball</a></div><div class="ttdeci">VecType ball()</div><div class="ttdoc">Returns point within a unit ball.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00134">al_Random.hpp:134</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_aaf55963e0a215d9a4547bf3d1fece2d2"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#aaf55963e0a215d9a4547bf3d1fece2d2">al::rnd::Random::uniform</a></div><div class="ttdeci">T uniform(const T &hi)</div><div class="ttdoc">Returns uniform random in [0, hi)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00099">al_Random.hpp:99</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_ab77ffe6ddb5585fcc974277307eeb4be"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#ab77ffe6ddb5585fcc974277307eeb4be">al::rnd::Random::uniform</a></div><div class="ttdeci">T uniform(const T &hi, const T &lo)</div><div class="ttdoc">Returns uniform random in [lo, hi)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00105">al_Random.hpp:105</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_abdc9398ca9eacec4b3352bbe8ac929cb"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#abdc9398ca9eacec4b3352bbe8ac929cb">al::rnd::Random::uniformS</a></div><div class="ttdeci">float uniformS()</div><div class="ttdoc">Returns uniform random in [-1, 1)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00110">al_Random.hpp:110</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_ac984eb9c0caece85dc10c8ab90870ec1"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#ac984eb9c0caece85dc10c8ab90870ec1">al::rnd::Random::sign</a></div><div class="ttdeci">float sign(float x=1.f)</div><div class="ttdoc">Returns argument with sign randomly flipped.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00403">al_Random.hpp:403</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_acd32211ca381c5a9a46ac4d2ae7dda85"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#acd32211ca381c5a9a46ac4d2ae7dda85">al::rnd::Random::shuffle</a></div><div class="ttdeci">void shuffle(T *arr, uint32_t len)</div><div class="ttdoc">Randomly shuffles elements in array.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00415">al_Random.hpp:415</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_ad4c1b2b2d802557f74ed85f87f5cf9d5"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#ad4c1b2b2d802557f74ed85f87f5cf9d5">al::rnd::Random::uniformS</a></div><div class="ttdeci">T uniformS(const T &lim)</div><div class="ttdoc">Returns uniform random in [-lim, lim)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00114">al_Random.hpp:114</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_ad8130a3fd11ecb4e2c74ce9518ed7d1f"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#ad8130a3fd11ecb4e2c74ce9518ed7d1f">al::rnd::Random::uniform</a></div><div class="ttdeci">float uniform()</div><div class="ttdoc">Returns uniform random in [0, 1)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00095">al_Random.hpp:95</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_ae09f815153a39382382f192cd854a6e9"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#ae09f815153a39382382f192cd854a6e9">al::rnd::Random::Random</a></div><div class="ttdeci">Random()</div><div class="ttdoc">Default constructor uses a randomly generated seed.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00080">al_Random.hpp:80</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_ae8ef6364412bac2cde94814751960284"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#ae8ef6364412bac2cde94814751960284">al::rnd::Random::triangle</a></div><div class="ttdeci">T triangle(const T &hi)</div><div class="ttdoc">Returns triangle distribution variate, in (-hi,hi)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00156">al_Random.hpp:156</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_random_html_afc43b4e498076d91d119e3b118cc1552"><div class="ttname"><a href="classal_1_1rnd_1_1_random.html#afc43b4e498076d91d119e3b118cc1552">al::rnd::Random::prob</a></div><div class="ttdeci">bool prob(float p)</div><div class="ttdoc">Returns true with a probability of p.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00167">al_Random.hpp:167</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_tausworthe_html"><div class="ttname"><a href="classal_1_1rnd_1_1_tausworthe.html">al::rnd::Tausworthe</a></div><div class="ttdoc">Combined Tausworthe uniform pseudo-random number generator.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00299">al_Random.hpp:299</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_tausworthe_html_a7d81888c685b9d3bbfca69af7f9c70cd"><div class="ttname"><a href="classal_1_1rnd_1_1_tausworthe.html#a7d81888c685b9d3bbfca69af7f9c70cd">al::rnd::Tausworthe::Tausworthe</a></div><div class="ttdeci">Tausworthe()</div><div class="ttdoc">Default constructor uses a randomly generated seed.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00323">al_Random.hpp:323</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_tausworthe_html_acab1f91bbb7305e77d3e78b620416bdf"><div class="ttname"><a href="classal_1_1rnd_1_1_tausworthe.html#acab1f91bbb7305e77d3e78b620416bdf">al::rnd::Tausworthe::seed</a></div><div class="ttdeci">void seed(uint32_t v)</div><div class="ttdoc">Set seed.</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00331">al_Random.hpp:331</a></div></div>
<div class="ttc" id="aclassal_1_1rnd_1_1_tausworthe_html_ae6f75bc27958a76423cd273dde14491e"><div class="ttname"><a href="classal_1_1rnd_1_1_tausworthe.html#ae6f75bc27958a76423cd273dde14491e">al::rnd::Tausworthe::operator()</a></div><div class="ttdeci">uint32_t operator()()</div><div class="ttdoc">Generate next uniform random integer in [0, 2^32)</div><div class="ttdef"><b>Definition:</b> <a href="al___random_8hpp_source.html#l00326">al_Random.hpp:326</a></div></div>
<div class="ttc" id="anamespaceal_1_1rnd_html_a25d395f63213c329c0f8c436c1b770cd"><div class="ttname"><a href="namespaceal_1_1rnd.html#a25d395f63213c329c0f8c436c1b770cd">al::rnd::uniformS</a></div><div class="ttdeci">float uniformS()</div><div class="ttdoc">Returns signed uniform random in (-1, 1)</div><div class="ttdef"><b>Definition:</b> <a href="al___std_random_8hpp_source.html#l00134">al_StdRandom.hpp:134</a></div></div>
<div class="ttc" id="anamespaceal_1_1rnd_html_a95b95f1416fd7a484cdbcacd470bdb23"><div class="ttname"><a href="namespaceal_1_1rnd.html#a95b95f1416fd7a484cdbcacd470bdb23">al::rnd::uniform</a></div><div class="ttdeci">float uniform()</div><div class="ttdoc">Returns uniform random in [0, 1)</div><div class="ttdef"><b>Definition:</b> <a href="al___std_random_8hpp_source.html#l00115">al_StdRandom.hpp:115</a></div></div>
<div class="ttc" id="anamespaceal_html"><div class="ttname"><a href="namespaceal.html">al</a></div><div class="ttdef"><b>Definition:</b> <a href="al___app_8hpp_source.html#l00023">al_App.hpp:23</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_e6bb53534ac0e427887cf7a94c0c004e.html">C:</a></li><li class="navelem"><a class="el" href="dir_8ceffd4ee35c3518d4e8bdc7e638efe8.html">Users</a></li><li class="navelem"><a class="el" href="dir_d934af30b392b1c85e577a193a4f44d7.html">Andres</a></li><li class="navelem"><a class="el" href="dir_e68da7aceac684d2d8b9f1b11e1c2d97.html">source</a></li><li class="navelem"><a class="el" href="dir_fcc7705357f5b24b756c781e261be61a.html">repos</a></li><li class="navelem"><a class="el" href="dir_c3c6d9593ff25ad9938aa507653e60f1.html">casm_viewer</a></li><li class="navelem"><a class="el" href="dir_62b775495639e85334a47dd0b350fd78.html">external</a></li><li class="navelem"><a class="el" href="dir_b57b95b4f0b0651157add3c4117135ea.html">tinc</a></li><li class="navelem"><a class="el" href="dir_a51c8fbca25ad649a2e41de73b4ed7a8.html">external</a></li><li class="navelem"><a class="el" href="dir_f6b0d4003da5aa0ecdbed61a62e8b0a3.html">allolib</a></li><li class="navelem"><a class="el" href="dir_1a17cbf7a13c3de19497337dcee9a11d.html">include</a></li><li class="navelem"><a class="el" href="dir_c24702039c85b0e1007cbbfcdd096437.html">al</a></li><li class="navelem"><a class="el" href="dir_28ad8dc9c9e98e8dc3b1f32a9f794e8f.html">math</a></li><li class="navelem"><b>al_Random.hpp</b></li>
<li class="footer">Generated on Thu Apr 8 2021 13:24:23 for Allolib by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>