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:

. . . 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)
after swapping rows 0 and 1:
. . . 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)
and after reordering columns:
. 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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.