Show / Hide Table of Contents

Class PermutationEnumerator<T>

Implements the Shimon Even variant of the Steinhaus–Johnson–Trotter algorithm.

https://en.wikipedia.org/wiki/Steinhaus%E2%80%93Johnson%E2%80%93Trotter_algorithm#Even.27s_speedup

Inheritance
System.Object
PermutationEnumerator<T>
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class PermutationEnumerator<T> : IEnumerator<T[]>
Type Parameters
T

Properties

Current

Returns the current permutation.

Declaration
public T[] Current { get; }
Property Value
T[]

Methods

Dispose()

Disposes a enumerator.

Declaration
public void Dispose()

MoveNext()

Moves to the next permutation.

Declaration
public bool MoveNext()
Returns
System.Boolean

Reset()

Resets the current enumeration.

Declaration
public void Reset()

Swap(Int32, Int32)

Actually executes a swap.

Declaration
public void Swap(int idx1, int idx2)
Parameters
System.Int32 idx1

System.Int32 idx2

Explicit Interface Implementations

IEnumerator.Current

Returns the current permutation.

Declaration
object IEnumerator.Current { get; }
Returns
System.Object

Back to top Built by Itinero, MIT licensed.