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.
 
 
 

661 lines
31 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>Combinatorics - 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" class="current">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">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</h2>
<div class="scroll">
<ul>
<li>
<a href="../MathNet.Numerics/AppSwitches.htm">AppSwitches</a>
</li>
<li>
<a href="../MathNet.Numerics/Combinatorics.htm" class="current">Combinatorics</a>
</li>
<li>
<a href="../MathNet.Numerics/Complex32.htm">Complex32</a>
</li>
<li>
<a href="../MathNet.Numerics/ComplexExtensions.htm">ComplexExtensions</a>
</li>
<li>
<a href="../MathNet.Numerics/Constants.htm">Constants</a>
</li>
<li>
<a href="../MathNet.Numerics/ContourIntegrate.htm">ContourIntegrate</a>
</li>
<li>
<a href="../MathNet.Numerics/Control.htm">Control</a>
</li>
<li>
<a href="../MathNet.Numerics/Differentiate.htm">Differentiate</a>
</li>
<li>
<a href="../MathNet.Numerics/DifferIntegrate.htm">DifferIntegrate</a>
</li>
<li>
<a href="../MathNet.Numerics/Distance.htm">Distance</a>
</li>
<li>
<a href="../MathNet.Numerics/Euclid.htm">Euclid</a>
</li>
<li>
<a href="../MathNet.Numerics/ExcelFunctions.htm">ExcelFunctions</a>
</li>
<li>
<a href="../MathNet.Numerics/FindMinimum.htm">FindMinimum</a>
</li>
<li>
<a href="../MathNet.Numerics/FindRoots.htm">FindRoots</a>
</li>
<li>
<a href="../MathNet.Numerics/Fit.htm">Fit</a>
</li>
<li>
<a href="../MathNet.Numerics/Generate.htm">Generate</a>
</li>
<li>
<a href="../MathNet.Numerics/GoodnessOfFit.htm">GoodnessOfFit</a>
</li>
<li>
<a href="../MathNet.Numerics/Integrate.htm">Integrate</a>
</li>
<li>
<a href="../MathNet.Numerics/Interpolate.htm">Interpolate</a>
</li>
<li>
<a href="../MathNet.Numerics/InvalidParameterException.htm">InvalidParameterException</a>
</li>
<li>
<a href="../MathNet.Numerics/IPrecisionSupport`1.htm">IPrecisionSupport&lt;T&gt;</a>
</li>
<li>
<a href="../MathNet.Numerics/MemoryAllocationException.htm">MemoryAllocationException</a>
</li>
<li>
<a href="../MathNet.Numerics/NativeInterfaceException.htm">NativeInterfaceException</a>
</li>
<li>
<a href="../MathNet.Numerics/NonConvergenceException.htm">NonConvergenceException</a>
</li>
<li>
<a href="../MathNet.Numerics/NumericalBreakdownException.htm">NumericalBreakdownException</a>
</li>
<li>
<a href="../MathNet.Numerics/Permutation.htm">Permutation</a>
</li>
<li>
<a href="../MathNet.Numerics/Polynomial.htm">Polynomial</a>
</li>
<li>
<a href="../MathNet.Numerics/Precision.htm">Precision</a>
</li>
<li>
<a href="../MathNet.Numerics/Series.htm">Series</a>
</li>
<li>
<a href="../MathNet.Numerics/SingularUMatrixException.htm">SingularUMatrixException</a>
</li>
<li>
<a href="../MathNet.Numerics/Sorting.htm">Sorting</a>
</li>
<li>
<a href="../MathNet.Numerics/SpecialFunctions.htm">SpecialFunctions</a>
</li>
<li>
<a href="../MathNet.Numerics/TestFunctions.htm">TestFunctions</a>
</li>
<li>
<a href="../MathNet.Numerics/Trig.htm">Trig</a>
</li>
<li>
<a href="../MathNet.Numerics/Window.htm">Window</a>
</li>
</ul>
</div>
</div>
<div class="header">
<p class="class"><strong>Type</strong> Combinatorics</p>
<p><strong>Namespace</strong> MathNet.Numerics</p>
</div>
<div class="sub-header">
<div id="summary">Enumerative Combinatorics and Counting.
</div>
<h3 class="section">Static Functions</h3>
<ul>
<li><a href="../MathNet.Numerics/Combinatorics.htm#Combinations">Combinations</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#CombinationsWithRepetition">CombinationsWithRepetition</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#GenerateCombination">GenerateCombination</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#GenerateCombination">GenerateCombination</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#GenerateCombinationWithRepetition">GenerateCombinationWithRepetition</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#GeneratePermutation">GeneratePermutation</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#GenerateVariation">GenerateVariation</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#GenerateVariationWithRepetition">GenerateVariationWithRepetition</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#Permutations">Permutations</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#SelectCombination``1">SelectCombination&lt;T&gt;</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#SelectCombinationWithRepetition``1">SelectCombinationWithRepetition&lt;T&gt;</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#SelectPermutation``1">SelectPermutation&lt;T&gt;</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#SelectPermutationInplace``1">SelectPermutationInplace&lt;T&gt;</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#SelectVariation``1">SelectVariation&lt;T&gt;</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#SelectVariationWithRepetition``1">SelectVariationWithRepetition&lt;T&gt;</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#Variations">Variations</a></li>
<li><a href="../MathNet.Numerics/Combinatorics.htm#VariationsWithRepetition">VariationsWithRepetition</a></li>
</ul>
</div>
<h3 class="section">Public Static Functions</h3>
<div id="Combinations" class="method">
<h4><span title="System.double">double</span> <strong>Combinations</strong>(<span title="System.int">int</span> n, <span title="System.int">int</span> k)</h4>
<div class="content">Count the number of possible combinations without repetition.
The order does not matter and each object can be chosen only once.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.int">int</span></code> n</h6>
<p class="comments">Number of elements in the set. </p>
<h6><code><span title="System.int">int</span></code> k</h6>
<p class="comments">Number of elements to choose from the set. Each element is chosen at most once. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.double">double</span></code></h6>
<p>Maximum number of combinations. </p>
</div>
</div>
</div>
<div id="CombinationsWithRepetition" class="method">
<h4><span title="System.double">double</span> <strong>CombinationsWithRepetition</strong>(<span title="System.int">int</span> n, <span title="System.int">int</span> k)</h4>
<div class="content">Count the number of possible combinations with repetition.
The order does not matter and an object can be chosen more than once.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.int">int</span></code> n</h6>
<p class="comments">Number of elements in the set. </p>
<h6><code><span title="System.int">int</span></code> k</h6>
<p class="comments">Number of elements to choose from the set. Each element is chosen 0, 1 or multiple times. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.double">double</span></code></h6>
<p>Maximum number of combinations with repetition. </p>
</div>
</div>
</div>
<div id="GenerateCombination" class="method">
<h4><span title="System.Boolean[]">Boolean[]</span> <strong>GenerateCombination</strong>(<span title="System.int">int</span> n, <span title="System.int">int</span> k, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Generate a random combination, without repetition, by randomly selecting k of N elements.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.int">int</span></code> n</h6>
<p class="comments">Number of elements in the set. </p>
<h6><code><span title="System.int">int</span></code> k</h6>
<p class="comments">Number of elements to choose from the set. Each element is chosen at most once. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.Boolean[]">Boolean[]</span></code></h6>
<p>Boolean mask array of length <code>N</code> , for each item true if it is selected. </p>
</div>
</div>
</div>
<div id="GenerateCombination" class="method">
<h4><span title="System.Boolean[]">Boolean[]</span> <strong>GenerateCombination</strong>(<span title="System.int">int</span> n, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Generate a random combination, without repetition, by randomly selecting some of N elements.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.int">int</span></code> n</h6>
<p class="comments">Number of elements in the set. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.Boolean[]">Boolean[]</span></code></h6>
<p>Boolean mask array of length <code>N</code> , for each item true if it is selected. </p>
</div>
</div>
</div>
<div id="GenerateCombinationWithRepetition" class="method">
<h4><span title="System.Int32[]">Int32[]</span> <strong>GenerateCombinationWithRepetition</strong>(<span title="System.int">int</span> n, <span title="System.int">int</span> k, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Generates a random combination, with repetition, by randomly selecting k of N elements.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.int">int</span></code> n</h6>
<p class="comments">Number of elements in the set. </p>
<h6><code><span title="System.int">int</span></code> k</h6>
<p class="comments">Number of elements to choose from the set. Elements can be chosen more than once. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.Int32[]">Int32[]</span></code></h6>
<p>Integer mask array of length <code>N</code> , for each item the number of times it was selected. </p>
</div>
</div>
</div>
<div id="GeneratePermutation" class="method">
<h4><span title="System.Int32[]">Int32[]</span> <strong>GeneratePermutation</strong>(<span title="System.int">int</span> n, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Generate a random permutation, without repetition, by generating the index numbers 0 to N-1 and shuffle them randomly.
Implemented using Fisher-Yates Shuffling.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.int">int</span></code> n</h6>
<p class="comments">Number of (distinguishable) elements in the set. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.Int32[]">Int32[]</span></code></h6>
<p>An array of length <code>N</code> that contains (in any order) the integers of the interval <code>[0, N)</code>. </p>
</div>
</div>
</div>
<div id="GenerateVariation" class="method">
<h4><span title="System.Int32[]">Int32[]</span> <strong>GenerateVariation</strong>(<span title="System.int">int</span> n, <span title="System.int">int</span> k, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Generate a random variation, without repetition, by randomly selecting k of n elements with order.
Implemented using partial Fisher-Yates Shuffling.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.int">int</span></code> n</h6>
<p class="comments">Number of elements in the set. </p>
<h6><code><span title="System.int">int</span></code> k</h6>
<p class="comments">Number of elements to choose from the set. Each element is chosen at most once. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.Int32[]">Int32[]</span></code></h6>
<p>An array of length <code>K</code> that contains the indices of the selections as integers of the interval <code>[0, N)</code>. </p>
</div>
</div>
</div>
<div id="GenerateVariationWithRepetition" class="method">
<h4><span title="System.Int32[]">Int32[]</span> <strong>GenerateVariationWithRepetition</strong>(<span title="System.int">int</span> n, <span title="System.int">int</span> k, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Generate a random variation, with repetition, by randomly selecting k of n elements with order.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.int">int</span></code> n</h6>
<p class="comments">Number of elements in the set. </p>
<h6><code><span title="System.int">int</span></code> k</h6>
<p class="comments">Number of elements to choose from the set. Elements can be chosen more than once. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.Int32[]">Int32[]</span></code></h6>
<p>An array of length <code>K</code> that contains the indices of the selections as integers of the interval <code>[0, N)</code>. </p>
</div>
</div>
</div>
<div id="Permutations" class="method">
<h4><span title="System.double">double</span> <strong>Permutations</strong>(<span title="System.int">int</span> n)</h4>
<div class="content">Count the number of possible permutations (without repetition).
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.int">int</span></code> n</h6>
<p class="comments">Number of (distinguishable) elements in the set. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.double">double</span></code></h6>
<p>Maximum number of permutations without repetition. </p>
</div>
</div>
</div>
<div id="SelectCombination``1" class="method">
<h4><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span> <strong>SelectCombination&lt;T&gt;</strong>(this <span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span> data, <span title="System.int">int</span> elementsToChoose, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Select a random combination, without repetition, from a data sequence by selecting k elements in original order.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span></code> data</h6>
<p class="comments">The data source to choose from. </p>
<h6><code><span title="System.int">int</span></code> elementsToChoose</h6>
<p class="comments">Number of elements (k) to choose from the data set. Each element is chosen at most once. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span></code></h6>
<p>The chosen combination, in the original order. </p>
</div>
</div>
</div>
<div id="SelectCombinationWithRepetition``1" class="method">
<h4><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span> <strong>SelectCombinationWithRepetition&lt;T&gt;</strong>(this <span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span> data, <span title="System.int">int</span> elementsToChoose, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Select a random combination, with repetition, from a data sequence by selecting k elements in original order.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span></code> data</h6>
<p class="comments">The data source to choose from. </p>
<h6><code><span title="System.int">int</span></code> elementsToChoose</h6>
<p class="comments">Number of elements (k) to choose from the data set. Elements can be chosen more than once. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span></code></h6>
<p>The chosen combination with repetition, in the original order. </p>
</div>
</div>
</div>
<div id="SelectPermutation``1" class="method">
<h4><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span> <strong>SelectPermutation&lt;T&gt;</strong>(this <span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span> data, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Select a random permutation from a data sequence by returning the provided data in random order.
Implemented using Fisher-Yates Shuffling.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span></code> data</h6>
<p class="comments">The data elements to be reordered. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
</div>
</div>
<div id="SelectPermutationInplace``1" class="method">
<h4><span title="System.void">void</span> <strong>SelectPermutationInplace&lt;T&gt;</strong>(<span title="MathNet.Numerics.T[]">T[]</span> data, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Select a random permutation, without repetition, from a data array by reordering the provided array in-place.
Implemented using Fisher-Yates Shuffling. The provided data array will be modified.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="MathNet.Numerics.T[]">T[]</span></code> data</h6>
<p class="comments">The data array to be reordered. The array will be modified by this routine. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
</div>
</div>
<div id="SelectVariation``1" class="method">
<h4><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span> <strong>SelectVariation&lt;T&gt;</strong>(this <span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span> data, <span title="System.int">int</span> elementsToChoose, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Select a random variation, without repetition, from a data sequence by randomly selecting k elements in random order.
Implemented using partial Fisher-Yates Shuffling.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span></code> data</h6>
<p class="comments">The data source to choose from. </p>
<h6><code><span title="System.int">int</span></code> elementsToChoose</h6>
<p class="comments">Number of elements (k) to choose from the set. Each element is chosen at most once. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span></code></h6>
<p>The chosen variation, in random order. </p>
</div>
</div>
</div>
<div id="SelectVariationWithRepetition``1" class="method">
<h4><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span> <strong>SelectVariationWithRepetition&lt;T&gt;</strong>(this <span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span> data, <span title="System.int">int</span> elementsToChoose, <span title="System.Random">Random</span> randomSource)</h4>
<div class="content">Select a random variation, with repetition, from a data sequence by randomly selecting k elements in random order.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span></code> data</h6>
<p class="comments">The data source to choose from. </p>
<h6><code><span title="System.int">int</span></code> elementsToChoose</h6>
<p class="comments">Number of elements (k) to choose from the data set. Elements can be chosen more than once. </p>
<h6><code><span title="System.Random">Random</span></code> randomSource</h6>
<p class="comments">The random number generator to use. Optional; the default random source will be used if null. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.Collections.Generic.IEnumerable<T>">IEnumerable&lt;T&gt;</span></code></h6>
<p>The chosen variation with repetition, in random order. </p>
</div>
</div>
</div>
<div id="Variations" class="method">
<h4><span title="System.double">double</span> <strong>Variations</strong>(<span title="System.int">int</span> n, <span title="System.int">int</span> k)</h4>
<div class="content">Count the number of possible variations without repetition.
The order matters and each object can be chosen only once.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.int">int</span></code> n</h6>
<p class="comments">Number of elements in the set. </p>
<h6><code><span title="System.int">int</span></code> k</h6>
<p class="comments">Number of elements to choose from the set. Each element is chosen at most once. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.double">double</span></code></h6>
<p>Maximum number of distinct variations. </p>
</div>
</div>
</div>
<div id="VariationsWithRepetition" class="method">
<h4><span title="System.double">double</span> <strong>VariationsWithRepetition</strong>(<span title="System.int">int</span> n, <span title="System.int">int</span> k)</h4>
<div class="content">Count the number of possible variations with repetition.
The order matters and each object can be chosen more than once.
<div class="parameters">
<h5>Parameters</h5>
<h6><code><span title="System.int">int</span></code> n</h6>
<p class="comments">Number of elements in the set. </p>
<h6><code><span title="System.int">int</span></code> k</h6>
<p class="comments">Number of elements to choose from the set. Each element is chosen 0, 1 or multiple times. </p>
</div>
<div class="return">
<h5>Return</h5>
<h6><code><span title="System.double">double</span></code></h6>
<p>Maximum number of distinct variations with repetition. </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>