PermutationDescriptor class

An immutable one-to-one permutation.

Entry i is the source index connected to output index i. For example, [2, 0, 1] transforms [a, b, c] into [c, a, b].

Annotations

Constructors

PermutationDescriptor(Iterable<int> sourceIndices)
Creates and validates a permutation from output-to-source indices.
PermutationDescriptor.blockInterleave(int rows, int columns)
Creates a row-write, column-read block interleaving permutation.
factory
PermutationDescriptor.identity(int length)
Creates an identity permutation of length.
factory
PermutationDescriptor.reverse(int length)
Creates a permutation that reverses length elements.
factory
PermutationDescriptor.rotateLeft(int length, int amount)
Creates a left rotation of length elements by amount.
factory
PermutationDescriptor.rotateRight(int length, int amount)
Creates a right rotation of length elements by amount.
factory

Properties

configurationSignature → String
A deterministic signature suitable for generated definition names.
no setter
hashCode → int
The hash code for this object.
no setteroverride
isIdentity → bool
Whether this mapping leaves every element in place.
no setter
length → int
Number of permuted elements.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sourceIndices → List<int>
Output-to-source index mapping.
no setter

Methods

apply<T>(List<T> elements) → List<T>
Applies this permutation to elements.
applyPacked(BigInt value, {int elementWidth = 1}) → BigInt
Applies this permutation to fixed-width elements packed into value.
compose(PermutationDescriptor after) → PermutationDescriptor
Composes this mapping followed by after.
inverse() → PermutationDescriptor
Returns the permutation that restores this permutation's input order.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sourceIndex(int outputIndex) → int
Returns the source index connected to outputIndex.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override