Math.NET Numerics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

447 lines
19 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>RandomExtensions - Math.NET Numerics Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link type="text/css" rel="stylesheet" href="../main.css"/>
<script type="text/javascript" src="../js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../js/jquery.scrollTo-min.js"></script>
<script type="text/javascript" src="../js/navigation.js"></script>
<script type="text/javascript" src="../js/example.js"></script>
</head>
<body><div id="namespaces">
<h2 class="fixed">Namespaces</h2>
<div class="scroll">
<ul>
<li>
<a href="../MathNet.Numerics/index.htm">MathNet.Numerics</a>
</li>
<li>
<a href="../MathNet.Numerics.Differentiation/index.htm">MathNet.Numerics.Differentiation</a>
</li>
<li>
<a href="../MathNet.Numerics.Distributions/index.htm">MathNet.Numerics.Distributions</a>
</li>
<li>
<a href="../MathNet.Numerics.Financial/index.htm">MathNet.Numerics.Financial</a>
</li>
<li>
<a href="../MathNet.Numerics.IntegralTransforms/index.htm">MathNet.Numerics.IntegralTransforms</a>
</li>
<li>
<a href="../MathNet.Numerics.Integration/index.htm">MathNet.Numerics.Integration</a>
</li>
<li>
<a href="../MathNet.Numerics.Interpolation/index.htm">MathNet.Numerics.Interpolation</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra/index.htm">MathNet.Numerics.LinearAlgebra</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra.Complex/index.htm">MathNet.Numerics.LinearAlgebra.Complex</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra.Complex.Solvers/index.htm">MathNet.Numerics.LinearAlgebra.Complex.Solvers</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra.Complex32/index.htm">MathNet.Numerics.LinearAlgebra.Complex32</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra.Complex32.Solvers/index.htm">MathNet.Numerics.LinearAlgebra.Complex32.Solvers</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra.Double/index.htm">MathNet.Numerics.LinearAlgebra.Double</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra.Double.Solvers/index.htm">MathNet.Numerics.LinearAlgebra.Double.Solvers</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra.Factorization/index.htm">MathNet.Numerics.LinearAlgebra.Factorization</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra.Single/index.htm">MathNet.Numerics.LinearAlgebra.Single</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra.Single.Solvers/index.htm">MathNet.Numerics.LinearAlgebra.Single.Solvers</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra.Solvers/index.htm">MathNet.Numerics.LinearAlgebra.Solvers</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearAlgebra.Storage/index.htm">MathNet.Numerics.LinearAlgebra.Storage</a>
</li>
<li>
<a href="../MathNet.Numerics.LinearRegression/index.htm">MathNet.Numerics.LinearRegression</a>
</li>
<li>
<a href="../MathNet.Numerics.OdeSolvers/index.htm">MathNet.Numerics.OdeSolvers</a>
</li>
<li>
<a href="../MathNet.Numerics.Optimization/index.htm">MathNet.Numerics.Optimization</a>
</li>
<li>
<a href="../MathNet.Numerics.Optimization.LineSearch/index.htm">MathNet.Numerics.Optimization.LineSearch</a>
</li>
<li>
<a href="../MathNet.Numerics.Optimization.ObjectiveFunctions/index.htm">MathNet.Numerics.Optimization.ObjectiveFunctions</a>
</li>
<li>
<a href="../MathNet.Numerics.Optimization.TrustRegion/index.htm">MathNet.Numerics.Optimization.TrustRegion</a>
</li>
<li>
<a href="../MathNet.Numerics.Providers/index.htm">MathNet.Numerics.Providers</a>
</li>
<li>
<a href="../MathNet.Numerics.Providers.FourierTransform/index.htm">MathNet.Numerics.Providers.FourierTransform</a>
</li>
<li>
<a href="../MathNet.Numerics.Providers.LinearAlgebra/index.htm">MathNet.Numerics.Providers.LinearAlgebra</a>
</li>
<li>
<a href="../MathNet.Numerics.Providers.SparseSolver/index.htm">MathNet.Numerics.Providers.SparseSolver</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/index.htm" class="current">MathNet.Numerics.Random</a>
</li>
<li>
<a href="../MathNet.Numerics.RootFinding/index.htm">MathNet.Numerics.RootFinding</a>
</li>
<li>
<a href="../MathNet.Numerics.Statistics/index.htm">MathNet.Numerics.Statistics</a>
</li>
<li>
<a href="../MathNet.Numerics.Statistics.Mcmc/index.htm">MathNet.Numerics.Statistics.Mcmc</a>
</li>
</ul>
</div>
</div><div id="types">
<h2 class="fixed">Types in MathNet.Numerics.Random</h2>
<div class="scroll">
<ul>
<li>
<a href="../MathNet.Numerics.Random/CryptoRandomSource.htm">CryptoRandomSource</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/Mcg31m1.htm">Mcg31m1</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/Mcg59.htm">Mcg59</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/MersenneTwister.htm">MersenneTwister</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/Mrg32k3a.htm">Mrg32k3a</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/Palf.htm">Palf</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/RandomExtensions.htm" class="current">RandomExtensions</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/RandomSeed.htm">RandomSeed</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/RandomSource.htm">RandomSource</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/SystemRandomSource.htm">SystemRandomSource</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/WH1982.htm">WH1982</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/WH2006.htm">WH2006</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/Xorshift.htm">Xorshift</a>
</li>
<li>
<a href="../MathNet.Numerics.Random/Xoshiro256StarStar.htm">Xoshiro256StarStar</a>
</li>
</ul>
</div>
</div>
<div class="header">
<p class="class"><strong>Type</strong> RandomExtensions</p>
<p><strong>Namespace</strong> MathNet.Numerics.Random</p>
</div>
<div class="sub-header">
<div id="summary">This class implements extension methods for the System.Random class. The extension methods generate
pseudo-random distributed numbers for types other than double and int32.
</div>
<h3 class="section">Static Functions</h3>
<ul>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextBoolean">NextBoolean</a></li>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextBytes">NextBytes</a></li>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextDecimal">NextDecimal</a></li>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextDoubles">NextDoubles</a></li>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextDoubles">NextDoubles</a></li>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextDoubleSequence">NextDoubleSequence</a></li>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextFullRangeInt32">NextFullRangeInt32</a></li>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextFullRangeInt64">NextFullRangeInt64</a></li>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextInt32s">NextInt32s</a></li>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextInt32s">NextInt32s</a></li>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextInt32Sequence">NextInt32Sequence</a></li>
<li><a href="../MathNet.Numerics.Random/RandomExtensions.htm#NextInt64">NextInt64</a></li>
</ul>
</div>
<h3 class="section">Public Static Functions</h3>
<div id="NextBoolean" class="method">
<h4><span title="System.bool">bool</span> <strong>NextBoolean</strong>(this <span title="System.Random">Random</span> rnd)</h4>
<div class="content">Returns a random boolean. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Random">Random</span></code> rnd</h6>
<p class="comments">The random number generator. </p>
</div>
</div>
</div>
<div id="NextBytes" class="method">
<h4><span title="System.Byte[]">Byte[]</span> <strong>NextBytes</strong>(this <span title="System.Random">Random</span> rnd, <span title="System.int">int</span> count)</h4>
<div class="content">Returns an array of uniform random bytes. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Random">Random</span></code> rnd</h6>
<p class="comments">The random number generator. </p>
<h6><code><span title="System.int">int</span></code> count</h6>
<p class="comments">The size of the array to fill. </p>
</div>
</div>
</div>
<div id="NextDecimal" class="method">
<h4><span title="System.decimal">decimal</span> <strong>NextDecimal</strong>(this <span title="System.Random">Random</span> rnd)</h4>
<div class="content">Returns a nonnegative decimal floating point random number less than 1.0. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Random">Random</span></code> rnd</h6>
<p class="comments">The random number generator. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.decimal">decimal</span></code></h6>
<p>A decimal floating point number greater than or equal to 0.0, and less than 1.0; that is,
the range of return values includes 0.0 but not 1.0. </p>
</div>
</div>
</div>
<div id="NextDoubles" class="method">
<h4><span title="System.void">void</span> <strong>NextDoubles</strong>(this <span title="System.Random">Random</span> rnd, <span title="System.Double[]">Double[]</span> values)</h4>
<div class="content">Fills an array with uniform random numbers greater than or equal to 0.0 and less than 1.0. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Random">Random</span></code> rnd</h6>
<p class="comments">The random number generator. </p>
<h6><code><span title="System.Double[]">Double[]</span></code> values</h6>
<p class="comments">The array to fill with random values. </p>
</div>
</div>
</div>
<div id="NextDoubles" class="method">
<h4><span title="System.Double[]">Double[]</span> <strong>NextDoubles</strong>(this <span title="System.Random">Random</span> rnd, <span title="System.int">int</span> count)</h4>
<div class="content">Returns an array of uniform random numbers greater than or equal to 0.0 and less than 1.0. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Random">Random</span></code> rnd</h6>
<p class="comments">The random number generator. </p>
<h6><code><span title="System.int">int</span></code> count</h6>
<p class="comments">The size of the array to fill. </p>
</div>
</div>
</div>
<div id="NextDoubleSequence" class="method">
<h4><span title="System.Collections.Generic.IEnumerable<double>">IEnumerable&lt;double&gt;</span> <strong>NextDoubleSequence</strong>(this <span title="System.Random">Random</span> rnd)</h4>
<div class="content">Returns an infinite sequence of uniform random numbers greater than or equal to 0.0 and less than 1.0. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
</div>
</div>
<div id="NextFullRangeInt32" class="method">
<h4><span title="System.int">int</span> <strong>NextFullRangeInt32</strong>(this <span title="System.Random">Random</span> rnd)</h4>
<div class="content">Returns a random number of the full Int32 range. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Random">Random</span></code> rnd</h6>
<p class="comments">The random number generator. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.int">int</span></code></h6>
<p>A 32-bit signed integer of the full range, including 0, negative numbers, <a href="../System/Int32.htm#MaxValue">MaxValue</a> and <a href="../System/Int32.htm#MinValue">MinValue</a>. </p>
</div>
</div>
</div>
<div id="NextFullRangeInt64" class="method">
<h4><span title="System.long">long</span> <strong>NextFullRangeInt64</strong>(this <span title="System.Random">Random</span> rnd)</h4>
<div class="content">Returns a random number of the full Int64 range. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Random">Random</span></code> rnd</h6>
<p class="comments">The random number generator. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.long">long</span></code></h6>
<p>A 64-bit signed integer of the full range, including 0, negative numbers, <a href="../System/Int64.htm#MaxValue">MaxValue</a> and <a href="../System/Int64.htm#MinValue">MinValue</a>. </p>
</div>
</div>
</div>
<div id="NextInt32s" class="method">
<h4><span title="System.void">void</span> <strong>NextInt32s</strong>(this <span title="System.Random">Random</span> rnd, <span title="System.Int32[]">Int32[]</span> values)</h4>
<div class="content">Fills an array with uniform random 32-bit signed integers greater than or equal to zero and less than <span title="MaxValue">MaxValue</span>. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Random">Random</span></code> rnd</h6>
<p class="comments">The random number generator. </p>
<h6><code><span title="System.Int32[]">Int32[]</span></code> values</h6>
<p class="comments">The array to fill with random values. </p>
</div>
</div>
</div>
<div id="NextInt32s" class="method">
<h4><span title="System.void">void</span> <strong>NextInt32s</strong>(this <span title="System.Random">Random</span> rnd, <span title="System.Int32[]">Int32[]</span> values, <span title="System.int">int</span> minInclusive, <span title="System.int">int</span> maxExclusive)</h4>
<div class="content">Fills an array with uniform random 32-bit signed integers within the specified range. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Random">Random</span></code> rnd</h6>
<p class="comments">The random number generator. </p>
<h6><code><span title="System.Int32[]">Int32[]</span></code> values</h6>
<p class="comments">The array to fill with random values. </p>
<h6><code><span title="System.int">int</span></code> minInclusive</h6>
<p class="comments">Lower bound, inclusive. </p>
<h6><code><span title="System.int">int</span></code> maxExclusive</h6>
<p class="comments">Upper bound, exclusive. </p>
</div>
</div>
</div>
<div id="NextInt32Sequence" class="method">
<h4><span title="System.Collections.Generic.IEnumerable<int>">IEnumerable&lt;int&gt;</span> <strong>NextInt32Sequence</strong>(this <span title="System.Random">Random</span> rnd, <span title="System.int">int</span> minInclusive, <span title="System.int">int</span> maxExclusive)</h4>
<div class="content">Returns an infinite sequence of uniform random numbers greater than or equal to 0.0 and less than 1.0. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
</div>
</div>
<div id="NextInt64" class="method">
<h4><span title="System.long">long</span> <strong>NextInt64</strong>(this <span title="System.Random">Random</span> rnd)</h4>
<div class="content">Returns a nonnegative random number less than <span title="MaxValue">MaxValue</span>. <blockquote class="remarks">
This extension is thread-safe if and only if called on an random number
generator provided by Math.NET Numerics or derived from the RandomSource class.
</blockquote>
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Random">Random</span></code> rnd</h6>
<p class="comments">The random number generator. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.long">long</span></code></h6>
<p>A 64-bit signed integer greater than or equal to 0, and less than <a href="../System/Int64.htm#MaxValue">MaxValue</a> ; that is,
the range of return values includes 0 but not <a href="../System/Int64.htm#MaxValue">MaxValue</a>. </p>
</div>
</div>
</div>
<div id="footer">
<p>Based on v5.0.0.0 of MathNet.Numerics (Math.NET Numerics)</p>
<p>Generated by <a href="http://docu.jagregory.com">docu</a></p>
</div>
</body>
</html>