chickadee » srfi-179 » interval-permute

interval-permute interval permutationprocedure

The argument interval must be an interval, and the argument permutation must be a valid permutation with the same dimension as interval. It is an error if the arguments do not satisfy these conditions.

Heuristically, this function returns a new interval whose axes have been permuted in a way consistent with permutation. But we have to say how the entries of permutation are associated with the new interval.

We have chosen the following convention: If the permutation is $(\pi_0,\ldots,\pi_{d-1})$, and the argument interval represents the cross product $[l_0,u_0)\times[l_1,u_1)\times\cdots\times[l_{d-1},u_{d-1})$, then the result represents the cross product $[l_{\pi_0},u_{\pi_0})\times[l_{\pi_1},u_{\pi_1})\times\cdots\times[l_{\pi_{d-1}},u_{\pi_{d-1}})$.

For example, if the argument interval represents $[0,4)\times[0,8)\times[0,21)\times [0,16)$ and the permutation is #(3 0 1 2), then the result of (interval-permute interval permutation) will be the representation of $[0,16)\times [0,4)\times[0,8)\times[0,21)$.