Click or drag to resize

Permutation Class

Represents a permutation.
Inheritance Hierarchy
SystemObject
  Meta.Numerics.FunctionsPermutation

Namespace:  Meta.Numerics.Functions
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: 4.1.4
Syntax
public sealed class Permutation : IEquatable<Permutation>, 
	IFormattable

The Permutation type exposes the following members.

Properties
  NameDescription
Public propertyDimension
Gets the dimension of the permutation.
Public propertyIsDerangement
Gets a Boolean flag indicating whether the permutation is a derangement.
Public propertyIsEven
Gets a Boolean value that is true if the permutation is even and false if the permutation is odd.
Public propertyIsIdentity
Gets a Boolean value indicating whether the permutation is the identity.
Public propertyIsInvolution
Gets a Boolean flag indicating whether the permutation is an involution.
Public propertyOrder
Gets the order of the permutation.
Top
Methods
  NameDescription
Public methodApplyT
Applies the permutation to a list.
Public methodEquals(Object)
Determines whether the given object is equal to the permutation.
(Overrides ObjectEquals(Object).)
Public methodEquals(Permutation)
Determines whether the given permutation is equal to the permutation instance.
Public methodGetHashCode
Serves as the default hash function.
(Overrides ObjectGetHashCode.)
Public methodStatic memberGetPermutations
Generates all permutations of the given dimension.
Public methodStatic memberGetRandomPermutation
Get a random permutation.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberIdentity
Returns the identity permutation of the given dimension.
Public methodInverse
Gets the inverse of the permutation.
Public methodStatic memberParse
Converts a text representation into a permutation.
Public methodToString
Returns a string that represents the current object.
(Overrides ObjectToString.)
Public methodToString(String)
Converts the permutation to its string representation in the given format.
Public methodToString(String, IFormatProvider)
Converts the permutation to its string representation in the given format.
Public methodStatic memberTryParse
Attempts to convert a text representation into a permutation.
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Determines whether two permutations are equal.
Public operatorStatic memberInequality
Determines whether two permutations are not equal.
Public operatorStatic memberMultiply
Multiplies two permutations.
Top
Remarks

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).

See Also