permute<T> function

List<T> permute<T>(
  1. List<T> array,
  2. List<int> indices
)

Permutes the array according to the given indices.

Implementation

List<T> permute<T>(List<T> array, List<int> indices) {
  return indices.map((i) => array[i]).toList();
}