Namespaces

Types in MathNet.Numerics

Type Permutation

Namespace MathNet.Numerics

Class to represent a permutation for a subset of the natural numbers.

Constructors

Static Functions

Methods

Properties

Public Constructors

Permutation(Int32[] indices)

Initializes a new instance of the Permutation class.
Parameters
Int32[] indices

An array which represents where each integer is permuted too: indices[i] represents that integer i is permuted to location indices[i].

Public Static Functions

Permutation FromInversions(Int32[] inv)

Construct an array from a sequence of inversions.
Parameters
Int32[] inv

The set of inversions to construct the permutation from.

Return
Permutation

A permutation generated from a sequence of inversions.

Show Example
From wikipedia: the permutation 12043 has the inversions (0,2), (1,2) and (3,4). This would be
encoded using the array [22244]. 

Public Methods

bool Equals(object obj)

int GetHashCode()

Type GetType()

Permutation Inverse()

Computes the inverse of the permutation.
Return
Permutation

The inverse of the permutation.

Int32[] ToInversions()

Construct a sequence of inversions from the permutation.
Return
Int32[]

A sequence of inversions.

Show Example
From wikipedia: the permutation 12043 has the inversions (0,2), (1,2) and (3,4). This would be
encoded using the array [22244]. 

string ToString()

Public Properties

int Dimension get;

Gets the number of elements this permutation is over.

int Item get;

Computes where idx permutes too.