1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" /> 7 <style type="text/css"><!-- 8 span.static_style 9 { 10 font-size : 8pt; 11 color : white; 12 font-weight : bold; 13 background : #44f; 14 border-left : solid 1px #aaf; 15 border-top : solid 1px #aaf; 16 border-right : solid 1px #00c; 17 border-bottom : solid 1px #00c; 18 padding-left : 2px; 19 padding-right : 2px; 20 } 21 22 span.virtual_style 23 { 24 font-size : 8pt; 25 color : white; 26 font-weight : bold; 27 background : #0a0; 28 border-left : solid 1px #0f0; 29 border-top : solid 1px #0f0; 30 border-right : solid 1px #060; 31 border-bottom : solid 1px #060; 32 padding-left : 2px; 33 padding-right : 2px; 34 } 35 36 span.protected_style 37 { 38 font-size : 8pt; 39 color : white; 40 font-weight : bold; 41 background : #444; 42 border-left : solid 1px #ccc; 43 border-top : solid 1px #ccc; 44 border-right : solid 1px #222; 45 border-bottom : solid 1px #222; 46 padding-left : 2px; 47 padding-right : 2px; 48 } 49 --></style> 50 <title>nn::math::MersenneTwister </title> 51 </head> 52 <body> 53 <h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/math/Overview.html">math</a>::MersenneTwister</CODE> Class</h1> 54 <div class="section"> 55 <b>Header file: </b><CODE>nn/math.h</CODE> </div> 56 <h2>Syntax</h2> 57 <div class="section"> 58 <pre class="definition">class MersenneTwister</pre> 59 </div> 60 <h2>Description</h2> 61 <div class="section"> 62 <p>A random number generator class using the Mersenne twister.</p><p>The Mersenne twister is a random number generating algorithm that generates superior pseudo-random numbers, but it requires an internal state of roughly 2.5 KB.</p><p>This class uses the same parameters as <CODE>mt19937</CODE>, and the same initial state is obtained upon initialization.</p><p>Because the size of this class is large, caution is needed when allocating it on the stack.</p><p>The random number cycle is 2^19937 - 1.</p><!-- write here --></div> 63 <a name="struct" id="struct"> 64 <h2>Structures</h2> 65 <div class="section"> 66 <table class="members"> 67 <tr> 68 <th> 69 <a href="../../../nn/math/MersenneTwister/State/Overview.html"><CODE>nn::math::MersenneTwister::State</CODE> </a> 70 </th> 71 <td>Structure for saving the internal state of random number generation.</td> 72 </tr> </table> 73 </div> 74 </a> <a name="function" id="function"> 75 <h2>Member Functions</h2> 76 <div class="section"> 77 <table class="members"> 78 <tr> 79 <th class="category" colspan="3">Initialization and Finalization</th> 80 </tr> 81 <tr> 82 <td width="100"> </td> 83 <th> 84 <a href="../../../nn/math/MersenneTwister/Initialize.html"><CODE>Initialize</CODE> </a> 85 </th> 86 <td>Performs initialization.</td> 87 </tr> 88 <tr> 89 <td width="100"> </td> 90 <th> 91 <a href="../../../nn/math/MersenneTwister/Finalize.html"><CODE>Finalize</CODE> </a> 92 </th> 93 <td>Performs finalization.</td> 94 </tr> 95 <tr> 96 <th class="category" colspan="3">State Saving and Restoration</th> 97 </tr> 98 <tr> 99 <td width="100"> </td> 100 <th> 101 <a href="../../../nn/math/MersenneTwister/SaveState.html"><CODE>SaveState</CODE> </a> 102 </th> 103 <td>Saves the internal state.</td> 104 </tr> 105 <tr> 106 <td width="100"> </td> 107 <th> 108 <a href="../../../nn/math/MersenneTwister/RestoreState.html"><CODE>RestoreState</CODE> </a> 109 </th> 110 <td>Restores the internal state.</td> 111 </tr> 112 <tr> 113 <th class="category" colspan="3">Random Number Generation</th> 114 </tr> 115 <tr> 116 <td width="100"> </td> 117 <th> 118 <a href="../../../nn/math/MersenneTwister/GenerateRandomU32.html"><CODE>GenerateRandomU32</CODE> </a> 119 </th> 120 <td>Generates an unsigned 32-bit random integer.</td> 121 </tr> 122 <tr> 123 <td width="100"> </td> 124 <th> 125 <a href="../../../nn/math/MersenneTwister/GenerateRandomU64.html"><CODE>GenerateRandomU64</CODE> </a> 126 </th> 127 <td>Generates an unsigned 64-bit random integer.</td> 128 </tr> 129 <tr> 130 <td width="100"> </td> 131 <th> 132 <a href="../../../nn/math/MersenneTwister/GenerateRandomF32.html"><CODE>GenerateRandomF32</CODE> </a> 133 </th> 134 <td>Generates a single, precision floating-point random number.</td> 135 </tr> 136 <tr> 137 <td width="100"> </td> 138 <th> 139 <a href="../../../nn/math/MersenneTwister/GenerateRandomF64.html"><CODE>GenerateRandomF64</CODE> </a> 140 </th> 141 <td>Generates a double, precision floating-point random number.</td> 142 </tr> 143 <tr> 144 <td width="100"> </td> 145 <th> 146 <a href="../../../nn/math/MersenneTwister/GenerateRandomN.html"><CODE>GenerateRandomN</CODE> </a> 147 </th> 148 <td>Generates a random number that is less than the specified number.</td> 149 </tr> 150 <tr> 151 <td width="100"> </td> 152 <th> 153 <a href="../../../nn/math/MersenneTwister/GenerateRandomBytes.html"><CODE>GenerateRandomBytes</CODE> </a> 154 </th> 155 <td>Generates a series of random bytes.</td> 156 </tr> </table> 157 </div> 158 </a> 159 <h2>Revision History</h2> 160 <div class="section"> 161 <dl class="history"> 162 <dt>2012/05/11</dt> 163 <dd>Initial version. <br /> 164 </dd> 165 </dl> 166 </div> 167 <hr><p>CONFIDENTIAL</p></body> 168</html>