Enumerates the indexes of all permutations of the specified length
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,
int length,
bool lexicographic,
int[] result
)
Public Shared Function Permutations (
count As Integer,
length As Integer,
lexicographic As Boolean,
result As Integer()
) As IEnumerable(Of Integer())
public:
static IEnumerable<array<int>^>^ Permutations(
int count,
int length,
bool lexicographic,
array<int>^ result
)
static member Permutations :
count : int *
length : int *
lexicographic : bool *
result : int[] -> IEnumerable<int[]>
Parameters
- count
- Type: SystemInt32
The size of the set to draw permutations from. - length
- Type: SystemInt32
The length of each permutation. - lexicographic
- Type: SystemBoolean
Specifies whether the permutations
should be returned in lexicographic order. - result
- Type: SystemInt32
An array that is to hold the result.
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 .
The indexes are returned each time in the same array,
result. Its elements should not be modified.
If they are modified, the results are unpredictable.
Reference