Member | Description |
new : size:int * mappings:seq<int * int> -> Permutation |
Create a permutation by specifying (source,destination) index pairs. For example,
Permutation(3,[ (0,2);(1,0); (2,1) ]) specifies a permutation that rotates
all elements left one place. Not all elements need be given, e.g.
Permutation(5,[ (1,2);(2,1) |]) specifies a permutation that swaps elements at indexes
1 and 2.
|
new : int array -> Permutation |
Create a permutation by specifying the result of permuting [| 0 .. n-1 |]. For example,
Permutation([| 1;2;0 |]) specifies a permutation that rotates all elements left one place.
|
member Compose : p1:Permutation * p2:Permutation -> Permutation |
Return a permutation that, when applied, first applies p1 then applies p2.
|
member Identity : size:int -> Permutation |
Return the iddentity permutation
|
member Reverse : size:int -> Permutation |
Return a permutation that, when applied, maps index 0 to N-1, N-1 to 0 etc.
|
member Rotate : size:int * ?distance:int -> Permutation |
Return a permutation that rotates right by the given distance. If the distance
is negative then a left rotation results.
|
member Swap : size:int * n:int * m:int -> Permutation |
Return a swaps the given two elements.
|