If I have a matrix that is iterated horizontally and then vertically it would enumerate like this:
0 1 2 3 4 5 6 7 8 9
------------------------------
0 | 1 2 3 4 5 6 7 8 9 10
1 | 11 12 13 14 15 16 17 18 19 20
2 | 21 22 23 24 25 26 27 28 29 30
if I want to enumerate vertically I could do this:
total_rows * coln+ rown+ 1
0 1 2 3 4 5 6 7 8 9
--------------------------
0 |1 4 7 10 13 16 19 22 25 28
1 |2 5 8 11 14 17 20 23 26 29
2 |3 6 9 12 15 18 21 24 27 30
anybody have the algorithm handy to enumerate grouped columns vertically?
????
0 1 2 3 4 5 6 7 8 9
------------------------------
0 |1 2 7 8 13 14 19 20 25 26
1 |3 4 9 10 15 16 21 22 27 28
2 |5 6 11 12 17 18 23 24 29 30