compose method

PermutationDescriptor compose(
  1. PermutationDescriptor after
)

Composes this mapping followed by after.

The returned descriptor is equivalent to after.apply(apply(elements)).

Implementation

PermutationDescriptor compose(PermutationDescriptor after) {
  if (length != after.length) {
    throw RohdHclException(
      'Cannot compose permutations of lengths $length and ${after.length}.',
    );
  }
  return PermutationDescriptor([
    for (final sourceInThisOutput in after._sourceIndices)
      _sourceIndices[sourceInThisOutput],
  ]);
}