| 1 | <html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 | <title>Permutation: Table jump...</title> |
| 3 | <style> |
| 4 | td { padding-left: 5pt; padding-right: 5pt; } |
| 5 | th { padding-left: 5pt; padding-right: 5pt; } |
| 6 | code { white-space: pre-wrap; } |
| 7 | dd { white-space: pre-wrap; } |
| 8 | </style> |
| 9 | </head><body bgcolor="#FFFFFF"> |
| 10 | |
| 11 | <table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b> |
| 12 | Permutation: Table jump... |
| 13 | </b></font></table></table> |
| 14 | <p>Reorder by jumping columnwise to next row over the permutation indices layed out like a table with <i>jumpSize</i> columns. </p> |
| 15 | <h2>Settings</h2> |
| 16 | <dl> |
| 17 | <dt><b>Jump size</b> |
| 18 | <dd>defines how many indices to jump over, i.e. the number of columns in the "table".</dd> |
| 19 | <dt><b>First</b> |
| 20 | <dd>The first new position.</dd> |
| 21 | </dl> |
| 22 | <h2>Example 1</h2> |
| 23 | <p>Consider the identity permutation of 14 elements layed out like a table with <i>jumpSize</i> = 4 columns.</p> |
| 24 | <code> 1 2 3 4<br></code> |
| 25 | <code> 5 6 7 8<br></code> |
| 26 | <code> 9 10 11 12<br></code> |
| 27 | <code> 13 14<br></code> |
| 28 | <p>1. <b>Table jump: 4, 1</b> will result in the permutation (1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 4, 8, 12)</p> |
| 29 | <p>2. <b>Table jump: 4, 2</b> will result in the permutation (2, 6, 10, 14, 3, 7, 11, 4, 8, 12, 1, 5. 9, 13)</p> |
| 30 | <p>3. <b>Table jump: 4, 5</b> will result in the permutation (5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 4, 8, 12, 1)</p> |
| 31 | <p>4. <b>Table jump: 4, 12</b> will result in the permutation (12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 4, 8)</p> |
| 32 | <h2>Example 2</h2> |
| 33 | <p>Consider the identity permutation of 14 elements layed out like a table with <i>jumpSize</i> = 7 columns.</p> |
| 34 | <code> 1 2 3 4 5 6 7<br></code> |
| 35 | <code> 8 9 10 11 12 13 14<br></code> |
| 36 | <p>1. <b>Table jump: 7, 1</b> will result in the permutation (1, 8, 2, 9, 3, 10, 4, 11, 5, 12, 6, 13, 7, 14)</p> |
| 37 | <hr> |
| 38 | <address> |
| 39 | <p>© djmw 20191211</p> |
| 40 | </address> |
| 41 | </body> |
| 42 | </html> |