index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta name="generator" content="rustdoc">
  7. <meta name="description" content="API documentation for the Rust `distributions` mod in crate `rand`.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, distributions">
  9. <title>rand::distributions - Rust</title>
  10. <link rel="stylesheet" type="text/css" href="../../normalize.css">
  11. <link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle">
  12. <link rel="stylesheet" type="text/css" href="../../dark.css">
  13. <link rel="stylesheet" type="text/css" href="../../main.css" id="themeStyle">
  14. <script src="../../storage.js"></script>
  15. <link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico">
  16. </head>
  17. <body class="rustdoc mod">
  18. <!--[if lte IE 8]>
  19. <div class="warning">
  20. This old browser is unsupported and will most likely display funky
  21. things.
  22. </div>
  23. <![endif]-->
  24. <nav class="sidebar">
  25. <div class="sidebar-menu">&#9776;</div>
  26. <a href='../../rand/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk.png' alt='logo' width='100'></a>
  27. <p class='location'>Module distributions</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../index.html'>rand</a></p><script>window.sidebarCurrent = {name: 'distributions', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div>
  28. </nav>
  29. <div class="theme-picker">
  30. <button id="theme-picker" aria-label="Pick another theme!">
  31. <img src="../../brush.svg" width="18" alt="Pick another theme!">
  32. </button>
  33. <div id="theme-choices"></div>
  34. </div>
  35. <script src="../../theme.js"></script>
  36. <nav class="sub">
  37. <form class="search-form js-only">
  38. <div class="search-container">
  39. <input class="search-input" name="search"
  40. autocomplete="off"
  41. placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
  42. type="search">
  43. </div>
  44. </form>
  45. </nav>
  46. <section id='main' class="content">
  47. <h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>rand</a>::<wbr><a class="mod" href=''>distributions</a></span><span class='out-of-band'><span id='render-detail'>
  48. <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
  49. [<span class='inner'>&#x2212;</span>]
  50. </a>
  51. </span><a class='srclink' href='../../src/rand/distributions/mod.rs.html#11-409' title='goto source code'>[src]</a></span></h1>
  52. <div class='docblock'><p>Sampling from random distributions.</p>
  53. <p>This is a generalization of <code>Rand</code> to allow parameters to control the
  54. exact properties of the generated values, e.g. the mean and standard
  55. deviation of a normal distribution. The <code>Sample</code> trait is the most
  56. general, and allows for generating values that change some state
  57. internally. The <code>IndependentSample</code> trait is for generating values
  58. that do not need to record state.</p>
  59. </div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
  60. <table><tr><td><code>pub use self::range::<a class="struct" href="../../rand/distributions/range/struct.Range.html" title="struct rand::distributions::range::Range">Range</a>;</code></td></tr><tr><td><code>pub use self::gamma::<a class="struct" href="../../rand/distributions/gamma/struct.Gamma.html" title="struct rand::distributions::gamma::Gamma">Gamma</a>;</code></td></tr><tr><td><code>pub use self::gamma::<a class="struct" href="../../rand/distributions/gamma/struct.ChiSquared.html" title="struct rand::distributions::gamma::ChiSquared">ChiSquared</a>;</code></td></tr><tr><td><code>pub use self::gamma::<a class="struct" href="../../rand/distributions/gamma/struct.FisherF.html" title="struct rand::distributions::gamma::FisherF">FisherF</a>;</code></td></tr><tr><td><code>pub use self::gamma::<a class="struct" href="../../rand/distributions/gamma/struct.StudentT.html" title="struct rand::distributions::gamma::StudentT">StudentT</a>;</code></td></tr><tr><td><code>pub use self::normal::<a class="struct" href="../../rand/distributions/normal/struct.Normal.html" title="struct rand::distributions::normal::Normal">Normal</a>;</code></td></tr><tr><td><code>pub use self::normal::<a class="struct" href="../../rand/distributions/normal/struct.LogNormal.html" title="struct rand::distributions::normal::LogNormal">LogNormal</a>;</code></td></tr><tr><td><code>pub use self::exponential::<a class="struct" href="../../rand/distributions/exponential/struct.Exp.html" title="struct rand::distributions::exponential::Exp">Exp</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
  61. <table>
  62. <tr class=' module-item'>
  63. <td><a class="mod" href="exponential/index.html"
  64. title='mod rand::distributions::exponential'>exponential</a></td>
  65. <td class='docblock-short'>
  66. <p>The exponential distribution.</p>
  67. </td>
  68. </tr>
  69. <tr class=' module-item'>
  70. <td><a class="mod" href="gamma/index.html"
  71. title='mod rand::distributions::gamma'>gamma</a></td>
  72. <td class='docblock-short'>
  73. <p>The Gamma and derived distributions.</p>
  74. </td>
  75. </tr>
  76. <tr class=' module-item'>
  77. <td><a class="mod" href="normal/index.html"
  78. title='mod rand::distributions::normal'>normal</a></td>
  79. <td class='docblock-short'>
  80. <p>The normal and derived distributions.</p>
  81. </td>
  82. </tr>
  83. <tr class=' module-item'>
  84. <td><a class="mod" href="range/index.html"
  85. title='mod rand::distributions::range'>range</a></td>
  86. <td class='docblock-short'>
  87. <p>Generating numbers between two others.</p>
  88. </td>
  89. </tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
  90. <table>
  91. <tr class=' module-item'>
  92. <td><a class="struct" href="struct.RandSample.html"
  93. title='struct rand::distributions::RandSample'>RandSample</a></td>
  94. <td class='docblock-short'>
  95. <p>A wrapper for generating types that implement <code>Rand</code> via the
  96. <code>Sample</code> &amp; <code>IndependentSample</code> traits.</p>
  97. </td>
  98. </tr>
  99. <tr class=' module-item'>
  100. <td><a class="struct" href="struct.Weighted.html"
  101. title='struct rand::distributions::Weighted'>Weighted</a></td>
  102. <td class='docblock-short'>
  103. <p>A value with a particular weight for use with <code>WeightedChoice</code>.</p>
  104. </td>
  105. </tr>
  106. <tr class=' module-item'>
  107. <td><a class="struct" href="struct.WeightedChoice.html"
  108. title='struct rand::distributions::WeightedChoice'>WeightedChoice</a></td>
  109. <td class='docblock-short'>
  110. <p>A distribution that selects from a finite collection of weighted items.</p>
  111. </td>
  112. </tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
  113. <table>
  114. <tr class=' module-item'>
  115. <td><a class="trait" href="trait.IndependentSample.html"
  116. title='trait rand::distributions::IndependentSample'>IndependentSample</a></td>
  117. <td class='docblock-short'>
  118. <p><code>Sample</code>s that do not require keeping track of state.</p>
  119. </td>
  120. </tr>
  121. <tr class=' module-item'>
  122. <td><a class="trait" href="trait.Sample.html"
  123. title='trait rand::distributions::Sample'>Sample</a></td>
  124. <td class='docblock-short'>
  125. <p>Types that can be used to create a random instance of <code>Support</code>.</p>
  126. </td>
  127. </tr></table></section>
  128. <section id='search' class="content hidden"></section>
  129. <section class="footer"></section>
  130. <aside id="help" class="hidden">
  131. <div>
  132. <h1 class="hidden">Help</h1>
  133. <div class="shortcuts">
  134. <h2>Keyboard Shortcuts</h2>
  135. <dl>
  136. <dt><kbd>?</kbd></dt>
  137. <dd>Show this help dialog</dd>
  138. <dt><kbd>S</kbd></dt>
  139. <dd>Focus the search field</dd>
  140. <dt><kbd>↑</kbd></dt>
  141. <dd>Move up in search results</dd>
  142. <dt><kbd>↓</kbd></dt>
  143. <dd>Move down in search results</dd>
  144. <dt><kbd>↹</kbd></dt>
  145. <dd>Switch tab</dd>
  146. <dt><kbd>&#9166;</kbd></dt>
  147. <dd>Go to active search result</dd>
  148. <dt><kbd>+</kbd></dt>
  149. <dd>Expand all sections</dd>
  150. <dt><kbd>-</kbd></dt>
  151. <dd>Collapse all sections</dd>
  152. </dl>
  153. </div>
  154. <div class="infos">
  155. <h2>Search Tricks</h2>
  156. <p>
  157. Prefix searches with a type followed by a colon (e.g.
  158. <code>fn:</code>) to restrict the search to a given type.
  159. </p>
  160. <p>
  161. Accepted types are: <code>fn</code>, <code>mod</code>,
  162. <code>struct</code>, <code>enum</code>,
  163. <code>trait</code>, <code>type</code>, <code>macro</code>,
  164. and <code>const</code>.
  165. </p>
  166. <p>
  167. Search functions by type signature (e.g.
  168. <code>vec -> usize</code> or <code>* -> vec</code>)
  169. </p>
  170. </div>
  171. </div>
  172. </aside>
  173. <script>
  174. window.rootPath = "../../";
  175. window.currentCrate = "rand";
  176. </script>
  177. <script src="../../main.js"></script>
  178. <script defer src="../../search-index.js"></script>
  179. </body>
  180. </html>