Apologies for the lack of clarity. I neglected to mention that after swapping the rows I also reordered the columns so that they were in ascending order of the bitwise representation of their stars. So before:
after swapping rows 0 and 1:. . . x * * * (row 2, bit value 4) . . . * * * * (row 1, bit value 2) . * * . . . * (row 0, bit value 1) 0 1 1 2 6 6 7 (bitwise column values)
and after reordering columns:. . . x * * * (still row 2) . * * . . . * (was row 0, now row 1) . . . * * * * (was row 1, now row 0) 0 2 2 1 5 5 7 (new bitwise column values)
. x . . * * * . . * * . . * . * . . * * * 0 1 2 2 5 5 7 (new bitwise column values)
Similarly the second swap gives columns (0, 1, 4, 4, 3, 3, 7), and reordering the columns gives (0, 1, 3, 3, 4, 4, 7).
Does that make it any clearer?
Hugo
In reply to Re^2: better algorithm: bitwise reordering
by hv
in thread better algorithm: bitwise reordering
by hv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |