Iterators.CombinationsWithReplacement<T>(IList<T>, Int32) Method

Enumerates the indexes of all combinations with replacement of the specified length from a list of items.

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public static IEnumerable<T[]> CombinationsWithReplacement<T>(
	IList<T> items,
	int length
)

Parameters

items  IList<T>
A list of items.
length  Int32
The length of the combinations.

Type Parameters

T

Return Value

IEnumerable<T[]>
A sequence of integer arrays that contain the indexes of all combinations with replacement of length elements from items.

Exceptions

ArgumentNullException

items is null.

ArgumentOutOfRangeException

length is less than zero.

See Also