moonpool/dev/ocaml/Stdlib/Random/State/index.html
2023-08-29 18:39:53 +00:00

2 lines
No EOL
6.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>State (ocaml.Stdlib.Random.State)</title><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../../index.html">ocaml</a> &#x00BB; <a href="../../index.html">Stdlib</a> &#x00BB; <a href="../index.html">Random</a> &#x00BB; State</nav><header class="odoc-preamble"><h1>Module <code><span>Random.State</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p>The type of PRNG states.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make : <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Create a new state and initialize it with the given seed.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make_self_init"><a href="#val-make_self_init" class="anchor"></a><code><span><span class="keyword">val</span> make_self_init : <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Create a new state and initialize it with a random seed chosen in a system-dependent way. The seed is obtained as described in <a href="../index.html#val-self_init"><code>Random.self_init</code></a>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-copy"><a href="#val-copy" class="anchor"></a><code><span><span class="keyword">val</span> copy : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Return a copy of the given state.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-bits"><a href="#val-bits" class="anchor"></a><code><span><span class="keyword">val</span> bits : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> int</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-int"><a href="#val-int" class="anchor"></a><code><span><span class="keyword">val</span> int : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> int</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-full_int"><a href="#val-full_int" class="anchor"></a><code><span><span class="keyword">val</span> full_int : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> int</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-int32"><a href="#val-int32" class="anchor"></a><code><span><span class="keyword">val</span> int32 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../../Int32/index.html#type-t">Int32.t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../../Int32/index.html#type-t">Int32.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-nativeint"><a href="#val-nativeint" class="anchor"></a><code><span><span class="keyword">val</span> nativeint : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../../Nativeint/index.html#type-t">Nativeint.t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../../Nativeint/index.html#type-t">Nativeint.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-int64"><a href="#val-int64" class="anchor"></a><code><span><span class="keyword">val</span> int64 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../../Int64/index.html#type-t">Int64.t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../../Int64/index.html#type-t">Int64.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-float"><a href="#val-float" class="anchor"></a><code><span><span class="keyword">val</span> float : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>float <span class="arrow">&#45;&gt;</span></span> float</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-bool"><a href="#val-bool" class="anchor"></a><code><span><span class="keyword">val</span> bool : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-bits32"><a href="#val-bits32" class="anchor"></a><code><span><span class="keyword">val</span> bits32 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../../Int32/index.html#type-t">Int32.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-bits64"><a href="#val-bits64" class="anchor"></a><code><span><span class="keyword">val</span> bits64 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../../Int64/index.html#type-t">Int64.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-nativebits"><a href="#val-nativebits" class="anchor"></a><code><span><span class="keyword">val</span> nativebits : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../../Nativeint/index.html#type-t">Nativeint.t</a></span></code></div><div class="spec-doc"><p>These functions are the same as the basic functions, except that they use (and update) the given PRNG state instead of the default one.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-split"><a href="#val-split" class="anchor"></a><code><span><span class="keyword">val</span> split : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Draw a fresh PRNG state from the given PRNG state. (The given PRNG state is modified.) The new PRNG is statistically independent from the given PRNG. Data can be drawn from both PRNGs, in any order, without risk of correlation. Both PRNGs can be split later, arbitrarily many times.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0.0</li></ul></div></div></div></body></html>