Permutation Class |
Namespace: Meta.Numerics.Functions
The Permutation type exposes the following members.
Name | Description | |
---|---|---|
Dimension |
Gets the dimension of the permutation.
| |
IsDerangement |
Gets a Boolean flag indicating whether the permutation is a derangement.
| |
IsEven |
Gets a Boolean value that is true if the permutation is even and false if the permutation is odd.
| |
IsIdentity |
Gets a Boolean value indicating whether the permutation is the identity.
| |
IsInvolution |
Gets a Boolean flag indicating whether the permutation is an involution.
| |
Order |
Gets the order of the permutation.
|
Name | Description | |
---|---|---|
ApplyT |
Applies the permutation to a list.
| |
Equals(Object) |
Determines whether the given object is equal to the permutation.
(Overrides ObjectEquals(Object).) | |
Equals(Permutation) |
Determines whether the given permutation is equal to the permutation instance.
| |
GetHashCode | Serves as the default hash function. (Overrides ObjectGetHashCode.) | |
GetPermutations |
Generates all permutations of the given dimension.
| |
GetRandomPermutation |
Get a random permutation.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Identity |
Returns the identity permutation of the given dimension.
| |
Inverse |
Gets the inverse of the permutation.
| |
Parse |
Converts a text representation into a permutation.
| |
ToString | Returns a string that represents the current object. (Overrides ObjectToString.) | |
ToString(String) |
Converts the permutation to its string representation in the given format.
| |
ToString(String, IFormatProvider) |
Converts the permutation to its string representation in the given format.
| |
TryParse |
Attempts to convert a text representation into a permutation.
|
Name | Description | |
---|---|---|
Equality |
Determines whether two permutations are equal.
| |
Inequality |
Determines whether two permutations are not equal.
| |
Multiply |
Multiplies two permutations.
|
A permutation of dimension D is a re-ordering a set of D distinguishable objects. The most obvious application of permutations in programming is to re-order the elements of an ordered set, but the applications in applied and theoretical mathematics are vast.
You can instantiate a new permutation from its map or cycle notation using the Parse(String) or TryParse(String, Permutation) methods. You can enumerate all permutations of a given dimension using the GetPermutations(Int32) method, or get a random one of a given dimension using GetRandomPermutation(Int32, Random).
Once you have a permutation instance in hand, you can examine its properties (e.g. Order and IsDerangement), obtain its inverse (using Inverse), or combine it with another perumtation using group multiplication (Multiply(Permutation, Permutation)). You can also apply it (in-place!) to any IListT using ApplyT(IListT).