Skip to content

Instantly share code, notes, and snippets.

/* -----------------------------------------------------------------------------
*
* Module : Permute
* Copyright : (c) [2009..2010] Trevor L. McDonell
* License : BSD
*
* Forward permutation, characterised by a function that determines for each
* element in the source array where it should go in the target. The output
* array should be initialised with a default value, as the permutation may be
* between arrays of different sizes and some positions may never be touched.
/* -----------------------------------------------------------------------------
*
* Module : Permute
* Copyright : (c) [2009..2010] Trevor L. McDonell
* License : BSD
*
* Forward permutation, characterised by a function that determines for each
* element in the source array where it should go in the target. The output
* array should be initialised with a default value, as the permutation may be
* between arrays of different sizes and some positions may never be touched.