Skip to content

Reflected lexicographic order

Georg Muntingh edited this page Aug 17, 2017 · 13 revisions

In GoTools, the reflected lexicographic order [1], denoted by <, is used for unrolling multidimensional arrays of coefficients and weights in a linear array. This order is derived from the lexicographic order by inverting the internal order of the indices.

Example: double array

Explicitly for a double array,

$$ (a_1, a_2) < (b_1, b_2)\quad \Longleftrightarrow\quad a_2 < b_2\ \text{or}\ (a_2 = b_2\ \text{and}\ a_1 < b_1).$$

For indices in the Cartesian product $\{1,2,3\}\times \{1,2\}$, $$ 11 < 21 < 31 < 12 < 22 < 32.$$

Example: triple array

Explicitly for a triple array,

$$ (a_1, a_2, a_3) < (b_1, b_2, b_3)\quad \Longleftrightarrow\quad a_3 < b_3\ \text{or}\ (a_3 = b_3\ \text{and}\ a_2 < b_2)\ \text{or}\ (a_3 = b_3\ \text{and}\ a_2 = b_2\ \text{and}\ a_1 < b_1).$$

For indices in the Cartesian product $\{1,2,3\}\times \{1,2\}\times \{1,2\}$, $$ 111 < 211 < 311 < 121 < 221 < 321 < 112 < 212 < 312 < 122 < 222 < 322.$$

[1] http://oeis.org/wiki/Orderings#Reflected_lexicographic_order

Clone this wiki locally