unsigned transpose( unsigned m, int size ) __override { unsigned res = 0; for ( int y = 0; y < size; ++y ) { for ( int x = 0; x < size; ++x ) { int src = y * size + x; int dst = x * size + y; if ( m & ( 1u << src ) ) res |= 1u << dst; } } return res; }