Click or drag to resize

CombinatorialCombinationsT Method (IEnumerableT, Int32)

Generates all combinations of m elements selected from the list.

Namespace:  Gamelogic.Extensions.Algorithms
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public static IEnumerable<T[]> Combinations<T>(
	this IEnumerable<T> list,
	int m
)

Parameters

list
Type: System.Collections.GenericIEnumerableT
The list to select from.
m
Type: SystemInt32
The number of elements in each combination.

Type Parameters

T
The type of elements in the list.

Return Value

Type: IEnumerableT
IEnumerable<T[]>.

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).
Exceptions
ExceptionCondition
ArgumentOutOfRangeException m;must be nonnegative or m;must be smaller than n
See Also