I have a set of points on the unit hypercube in n dimensions:
$$ \boldsymbol I_n = \{\boldsymbol x = (x_1, ... , x_n) : 0 \leq x_i \leq 1,\ i = 1, ...,n \} $$
The goal is to transform these points to the part of the hypercube where the coordinates of the points are in a non-descending order, which is the simplex defined as:
$$ \boldsymbol T_n = \{\boldsymbol x = (x_1, ... , x_n) : 0 \leq x_1 \leq x_2 \leq ... \leq x_n \leq 1 \} $$
I want to do this using the mirror transformation described in "Section 2.3. Transformation Mirror", of this paper1.
The authors describe the transformation for $n=2$ and $n=3$ dimensions, and imply that it can be generalized for higher dimensions by stating that:
This transformation is fast, even for high dimensions.
However, they do not give a general method for $n$ dimensions, and I can't seem to figure out how to do it based on the 2 cases they present for 2 and 3 dimensions.
In case you can't access the article, here are the algorithms they give for 2 and 3 dimensions:
$ \boldsymbol{n = 2:} $
For the point $(x_1, x_2):$$$ \begin{align} \textrm{If} \quad x_1 \leq x_2 \quad& \textrm{then} \quad T(x_1, \,x_2) := (x_1, \, x_2), \\ &\textrm{else} \quad T(x_1, \, x_2) := (1 - x_1, \, 1 - x_2). \end{align} $$
$ \boldsymbol{n = 3:} $
For the point $(x_1, x_2, x_3):$$$ \begin{align} &\textrm{If}\quad x_3 \leq x_1 \quad\textrm{then}\quad (x_1,\, x_2,\, x_3) := (1-x_1, \, 1-x_2, \, 1-x_3),\\ &\textrm{If}\quad x_3 \leq x_2 \quad\textrm{then}\quad (x_1,\, x_2,\, x_3) := (x_1, \, 1-x_2+x_1, \, 1-x_3+x_1),\\ &\textrm{If}\quad x_2 \leq x_1 \quad\textrm{then}\quad (x_1,\, x_2,\, x_3) := (x_3-x_1, \, x_3-x_2, \, x_3) \end{align} $$
How would this look in $n$ dimensions?
1: Pillards, Tim; Cools, Ronald, Transforming low-discrepancy sequences from a cube to a simplex, J. Comput. Appl. Math. 174, No. 1, 29-42 (2005). ZBL1062.65006.
Update:
I think I have figured out part of the problem:
If we have the point $\boldsymbol{x}$, we essentially want to sort the coordinates in a non-descending order by performing these mirror operations described in the paper.
Lets say we have:
$$
\{\boldsymbol{x} = (x_1,...,x_i,...,x_j,...,x_n) : 0 \leq x_p \leq 1,\, p = 1,2,...,n\}
$$
and we compare the values of $x_i$ and $x_j$.
If they are not in the correct order (meaning $x_i > x_j$), then we perform the following mirror operation:
Mirror all the coordinates of this point $\boldsymbol x$ which fall on the interval $(x_{i-1}, x_{j+1})$ over the midpoint $\frac{x_{i-1}+x_{j+1}}{2}$ of this inverval:
$$\{x_k \in \boldsymbol x \,|\, x_{i-1} < x_k < x_{j+1}\}$$
$$x_k := x_{i-1} + x_{j+1} - x_k$$
If $i=1$ and/or $j=n$ then for this to work we will need to define $x_0$ and $x_{n+1}$, which are going to be the lower and upper bounds of the entire interval the coordinates are from:
$$x_0=0$$
$$x_{n+1}=1$$
Applying this to the cases shown in the paper:
$n=2:$
$$ x_0 = 0,\quad x_3 = 1$$
If $x_2 < x_1:$
$$ x_1 := x_0 + x_3 - x_1 = 1 - x_1 \\
x_2 := x_0 + x_3 - x_2 = 1 - x_2 $$
$n=3:$
$$ x_0 = 0,\quad x_4 = 1$$
If $x_3 < x_1:$
$$ x_1 := x_0 + x_4 - x_1 = 1 - x_1 \\
x_2 := x_0 + x_4 - x_2 = 1 - x_2 \\
x_3 := x_0 + x_4 - x_3 = 1 - x_3 $$
If $x_3 < x_2:$
$$ x_1 := x_1 \\
x_2 := x_1 + x_4 - x_2 = x_1 + 1 - x_2 \\
x_3 := x_1 + x_4 - x_3 = x_1 + 1 - x_3 $$
If $x_2 < x_1:$
$$ x_1 := x_3 - x_1 \\
x_2 := x_3 - x_2 \\
x_3 := x_3 $$