Anonymous user
Matrix transposition: Difference between revisions
→{{header|C}}: avoid unnecessary moves
(→{{header|C}}: avoid unnecessary moves) |
|||
Line 239:
double tmp;
for (start =
next = start;
i = 0;
do { next = (next % h) * w + next / h; } while (next > start);▼
do { i++;
if (next < start) continue;▼
} while (next > start);
▲ if (next < start || i == 1) continue;
tmp = m[next = start];
|