apply<T> method

List<T> apply<T>(
  1. List<T> elements
)

Applies this permutation to elements.

Implementation

List<T> apply<T>(List<T> elements) {
  if (elements.length != length) {
    throw RohdHclException(
        'Permutation length $length cannot reorder ${elements.length} '
        'elements.');
  }
  return List<T>.unmodifiable(
      _sourceIndices.map((sourceIndex) => elements[sourceIndex]));
}