276 lines
No EOL
13 KiB
HTML
276 lines
No EOL
13 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="generator" content="rustdoc">
|
||
<meta name="description" content="API documentation for the Rust `distributions` mod in crate `rand`.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, distributions">
|
||
|
||
<title>rand::distributions - Rust</title>
|
||
|
||
<link rel="stylesheet" type="text/css" href="../../normalize.css">
|
||
<link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle">
|
||
|
||
<link rel="stylesheet" type="text/css" href="../../dark.css">
|
||
<link rel="stylesheet" type="text/css" href="../../main.css" id="themeStyle">
|
||
<script src="../../storage.js"></script>
|
||
|
||
|
||
<link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico">
|
||
|
||
</head>
|
||
<body class="rustdoc mod">
|
||
<!--[if lte IE 8]>
|
||
<div class="warning">
|
||
This old browser is unsupported and will most likely display funky
|
||
things.
|
||
</div>
|
||
<![endif]-->
|
||
|
||
|
||
|
||
<nav class="sidebar">
|
||
<div class="sidebar-menu">☰</div>
|
||
<a href='../../rand/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk.png' alt='logo' width='100'></a>
|
||
<p class='location'>Module distributions</p><div class="sidebar-elems"><div class="block items"><ul><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>
|
||
</nav>
|
||
|
||
<div class="theme-picker">
|
||
<button id="theme-picker" aria-label="Pick another theme!">
|
||
<img src="../../brush.svg" width="18" alt="Pick another theme!">
|
||
</button>
|
||
<div id="theme-choices"></div>
|
||
</div>
|
||
<script src="../../theme.js"></script>
|
||
<nav class="sub">
|
||
<form class="search-form js-only">
|
||
<div class="search-container">
|
||
<input class="search-input" name="search"
|
||
autocomplete="off"
|
||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
||
type="search">
|
||
</div>
|
||
</form>
|
||
</nav>
|
||
|
||
<section id='main' class="content">
|
||
<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'>
|
||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
||
[<span class='inner'>−</span>]
|
||
</a>
|
||
</span><a class='srclink' href='../../src/rand/distributions/mod.rs.html#11-159' title='goto source code'>[src]</a></span></h1>
|
||
<div class='docblock'><p>Sampling from random distributions.</p>
|
||
<p>This is a generalization of <code>Rand</code> to allow parameters to control the
|
||
exact properties of the generated values, e.g. the mean and standard
|
||
deviation of a normal distribution. The <code>Sample</code> trait is the most
|
||
general, and allows for generating values that change some state
|
||
internally. The <code>IndependentSample</code> trait is for generating values
|
||
that do not need to record state.</p>
|
||
</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
|
||
<table>
|
||
<tr class=' module-item'>
|
||
<td><a class="mod" href="exponential/index.html"
|
||
title='mod rand::distributions::exponential'>exponential</a></td>
|
||
<td class='docblock-short'>
|
||
<p>The exponential distribution.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="mod" href="gamma/index.html"
|
||
title='mod rand::distributions::gamma'>gamma</a></td>
|
||
<td class='docblock-short'>
|
||
<p>The Gamma and derived distributions.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="mod" href="normal/index.html"
|
||
title='mod rand::distributions::normal'>normal</a></td>
|
||
<td class='docblock-short'>
|
||
<p>The normal and derived distributions.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="mod" href="range/index.html"
|
||
title='mod rand::distributions::range'>range</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Generating numbers between two others.</p>
|
||
|
||
</td>
|
||
</tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||
<table>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.ChiSquared.html"
|
||
title='struct rand::distributions::ChiSquared'>ChiSquared</a></td>
|
||
<td class='docblock-short'>
|
||
<p>The chi-squared distribution <code>χ²(k)</code>, where <code>k</code> is the degrees of
|
||
freedom.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.Exp.html"
|
||
title='struct rand::distributions::Exp'>Exp</a></td>
|
||
<td class='docblock-short'>
|
||
<p>The exponential distribution <code>Exp(lambda)</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.FisherF.html"
|
||
title='struct rand::distributions::FisherF'>FisherF</a></td>
|
||
<td class='docblock-short'>
|
||
<p>The Fisher F distribution <code>F(m, n)</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.Gamma.html"
|
||
title='struct rand::distributions::Gamma'>Gamma</a></td>
|
||
<td class='docblock-short'>
|
||
<p>The Gamma distribution <code>Gamma(shape, scale)</code> distribution.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.LogNormal.html"
|
||
title='struct rand::distributions::LogNormal'>LogNormal</a></td>
|
||
<td class='docblock-short'>
|
||
<p>The log-normal distribution <code>ln N(mean, std_dev**2)</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.Normal.html"
|
||
title='struct rand::distributions::Normal'>Normal</a></td>
|
||
<td class='docblock-short'>
|
||
<p>The normal distribution <code>N(mean, std_dev**2)</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.RandSample.html"
|
||
title='struct rand::distributions::RandSample'>RandSample</a></td>
|
||
<td class='docblock-short'>
|
||
<p>A wrapper for generating types that implement <code>Rand</code> via the
|
||
<code>Sample</code> & <code>IndependentSample</code> traits.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.Range.html"
|
||
title='struct rand::distributions::Range'>Range</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Sample values uniformly between two bounds.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.StudentT.html"
|
||
title='struct rand::distributions::StudentT'>StudentT</a></td>
|
||
<td class='docblock-short'>
|
||
<p>The Student t distribution, <code>t(nu)</code>, where <code>nu</code> is the degrees of
|
||
freedom.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.Weighted.html"
|
||
title='struct rand::distributions::Weighted'>Weighted</a></td>
|
||
<td class='docblock-short'>
|
||
<p>A value with a particular weight for use with <code>WeightedChoice</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.WeightedChoice.html"
|
||
title='struct rand::distributions::WeightedChoice'>WeightedChoice</a></td>
|
||
<td class='docblock-short'>
|
||
<p>A distribution that selects from a finite collection of weighted items.</p>
|
||
|
||
</td>
|
||
</tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
|
||
<table>
|
||
<tr class=' module-item'>
|
||
<td><a class="trait" href="trait.IndependentSample.html"
|
||
title='trait rand::distributions::IndependentSample'>IndependentSample</a></td>
|
||
<td class='docblock-short'>
|
||
<p><code>Sample</code>s that do not require keeping track of state.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="trait" href="trait.Sample.html"
|
||
title='trait rand::distributions::Sample'>Sample</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Types that can be used to create a random instance of <code>Support</code>.</p>
|
||
|
||
</td>
|
||
</tr></table></section>
|
||
<section id='search' class="content hidden"></section>
|
||
|
||
<section class="footer"></section>
|
||
|
||
<aside id="help" class="hidden">
|
||
<div>
|
||
<h1 class="hidden">Help</h1>
|
||
|
||
<div class="shortcuts">
|
||
<h2>Keyboard Shortcuts</h2>
|
||
|
||
<dl>
|
||
<dt><kbd>?</kbd></dt>
|
||
<dd>Show this help dialog</dd>
|
||
<dt><kbd>S</kbd></dt>
|
||
<dd>Focus the search field</dd>
|
||
<dt><kbd>↑</kbd></dt>
|
||
<dd>Move up in search results</dd>
|
||
<dt><kbd>↓</kbd></dt>
|
||
<dd>Move down in search results</dd>
|
||
<dt><kbd>↹</kbd></dt>
|
||
<dd>Switch tab</dd>
|
||
<dt><kbd>⏎</kbd></dt>
|
||
<dd>Go to active search result</dd>
|
||
<dt><kbd>+</kbd></dt>
|
||
<dd>Expand all sections</dd>
|
||
<dt><kbd>-</kbd></dt>
|
||
<dd>Collapse all sections</dd>
|
||
</dl>
|
||
</div>
|
||
|
||
<div class="infos">
|
||
<h2>Search Tricks</h2>
|
||
|
||
<p>
|
||
Prefix searches with a type followed by a colon (e.g.
|
||
<code>fn:</code>) to restrict the search to a given type.
|
||
</p>
|
||
|
||
<p>
|
||
Accepted types are: <code>fn</code>, <code>mod</code>,
|
||
<code>struct</code>, <code>enum</code>,
|
||
<code>trait</code>, <code>type</code>, <code>macro</code>,
|
||
and <code>const</code>.
|
||
</p>
|
||
|
||
<p>
|
||
Search functions by type signature (e.g.
|
||
<code>vec -> usize</code> or <code>* -> vec</code>)
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
|
||
|
||
|
||
<script>
|
||
window.rootPath = "../../";
|
||
window.currentCrate = "rand";
|
||
</script>
|
||
<script src="../../main.js"></script>
|
||
<script defer src="../../search-index.js"></script>
|
||
</body>
|
||
</html> |