| PermutationItem Property |
Get an element of the
Permutation at the supplied column.
Namespace:
Kaos.Combinatorics
Assembly:
KaosCombinatorics (in KaosCombinatorics.dll) Version: 6.0.0.0
Syntax public int this[
int index
] { get; }
Parameters
- index
- Type: SystemInt32
Index value.
Return Value
Type:
Int32Sequence value at
index.
Exceptions Examples using System;
using System.Linq;
using Kaos.Combinatorics;
namespace ExampleApp
{
class PnExample05
{
static void Main()
{
var pn = new Permutation (choices:8, picks:4, rank:601);
Console.WriteLine ($"n={pn.Choices}, k={pn.Picks}, rank={pn.Rank}:\n");
var text = String.Concat (pn.Select (ei => (char) ('A' + ei)));
Console.WriteLine ($"{text}\n");
for (int i = 0; i < pn.Picks; ++i)
Console.WriteLine ($"Element at {i} is {pn[i]}");
}
}
}
See Also