Click or drag to resize

Permutation Constructor (Int32, Int32)

Initializes a new permutation from the elements supplied in source picked from the supplied number of choices.

Namespace:  Kaos.Combinatorics
Assembly:  KaosCombinatorics (in KaosCombinatorics.dll) Version: 6.0.0.0
Syntax
C#
public Permutation(
	int[] source,
	int choices
)

Parameters

source
Type: SystemInt32
Array of integers with elements in the range (0..choices-1).
choices
Type: SystemInt32
Number of values that source may pick from.
Exceptions
ExceptionCondition
ArgumentNullExceptionWhen source is null.
ArgumentOutOfRangeException When length of source is greater than 20 or contains invalid data; When source contains out of range values; When choices is less than 0 or greater than 20.
ArgumentExceptionWhen source contains repeated values.
Remarks
Supplying a value for choices that is greater than the number of elements in source will instantiate a k-permutation.
See Also