Click or drag to resize

CombinatoricsSelectCombinationWithRepetitionT Method

Select a random combination, with repetition, from a data sequence by selecting k elements in original order.

Namespace: Altaxo.Calc
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static IEnumerable<T> SelectCombinationWithRepetition<T>(
	this IEnumerable<T> data,
	int elementsToChoose,
	Random randomSource = null
)

Parameters

data  IEnumerableT
The data source to choose from.
elementsToChoose  Int32
Number of elements (k) to choose from the data set. Elements can be chosen more than once.
randomSource  Random  (Optional)
The random number generator to use. Optional; the default random source will be used if null.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Altaxo.Calc.Combinatorics.SelectCombinationWithRepetition``1(System.Collections.Generic.IEnumerable{``0},System.Int32,System.Random)"]

Return Value

IEnumerableT
The chosen combination with repetition, in the original order.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also