IMO, you can process your answer using an algorithm to handle this:
If the result is 8x8 :
0 1 2 3 4 5 6 7 1 0 3 2 5 4 7 6 2 3 0 1 6 7 4 5 3 2 1 0 7 6 5 4 4 5 6 7 0 1 2 3 5 4 7 6 1 0 3 2 6 7 4 5 2 3 0 1 7 6 5 4 3 2 1 0
You actually have a matrix of two 4x4 matrices in the following template:
m0 => 0 1 2 3 m1 => 4 5 6 7 pattern => m0 m1 1 0 3 2 5 4 7 6 m1 m0 2 3 0 1 6 7 4 5 3 2 1 0 7 6 5 4
And also each 4x4 is a matrix of two 2x2 matrices with respect to degree 2:
m0 => 0 1 m1 => 2 3 pattern => m0 m1 1 0 3 2 m1 m0
In another explanation, I have to say that you have a 2x2 matrix 0 and 1 , then you expand it to a 4x4 matrix, replacing each cell with a new 2x2 matrix:
0 => 0+2*0 1+2*0 1=> 0+2*1 1+2*1 1+2*0 0+2*0 1+2*1 0+2*1 result => 0 1 2 3 1 0 3 2 2 3 0 1 3 2 1 0
Now expand it again:
0,1=> as above 2=> 0+2*2 1+2*2 3=> 0+2*3 1+2*3 1+2*2 0+2*2 1+2*3 0+2*3
I can calculate the value of each cell using this C # code example:
// i: row, j: column, n: matrix dimension var v = 0; var m = 2; do { var p = m/2; v = v*2 + (i%(n/p) < n/m == j%(n/p) < n/m ? 0 : 1); m *= 2; } while (m <= n);
shA.t
source share