Morton Ordering
Re-arrange 2D matrix accesses to be more cache-friendly
a(0,0) a(0,1) a(0,2) a(0,3) a(0,4) a(0,5) a(0,6), a(0,7)
a(1,0) a(1,1) a(1,2) a(1,3) a(1,4) a(1,5) a(1,6), a(1,7)
a(2,0) a(2,1) a(2,2) a(2,3) a(2,4) a(2,5) a(2,6), a(2,7)
a(3,0) a(3,1) a(3,2) a(3,3) a(3,4) a(3,5) a(3,6), a(3,7)
a(4,0) a(4,1) a(4,2) a(4,3) a(4,4) a(4,5) a(4,6), a(4,7)
Matrix is typically stored in either Row Major or Column major order. If Row Major order, then rows are stored sequentially in memory, with adjacent column entries being adjacent in memory.
Morton ordering computes indices of KxK submatrix such that entries are stored sequentially in memory.