Enumerates the indexes of all permutations
from a set of the specified size.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static IEnumerable<int[]> Permutations(
int count,
bool lexicographic
)
Public Shared Function Permutations (
count As Integer,
lexicographic As Boolean
) As IEnumerable(Of Integer())
public:
static IEnumerable<array<int>^>^ Permutations(
int count,
bool lexicographic
)
static member Permutations :
count : int *
lexicographic : bool -> IEnumerable<int[]>
Parameters
- count
- Type: SystemInt32
The size of the set to draw permutations from. - lexicographic
- Type: SystemBoolean
Specifies whether the permutations
should be returned in lexicographic order.
Return Value
Type:
IEnumerableInt32A sequence of integer arrays that contain the indexes of
all permutations from a set of size
count.
If
lexicographic is
,
then the permutations are returned in lexicographic order.
When lexicographic order is not required, it is faster to set
lexicographic to .
Reference