On Thursday, 7 April 2016 at 13:09:22 UTC, Andrei Alexandrescu wrote:
if (less(r[0], r[1])) r.swapAt(0, 2);
if (less(r[1], r[3])) r.swapAt(1, 3);

Shouldn't it be

if (less(r[0], r[2])) r.swapAt(0, 2);
if (less(r[1], r[3])) r.swapAt(1, 3);

? Could you elaborate a bit on how this is used to express sorting? AFAICT, to become a full sorting network we need

if (less(r[0], r[2])) r.swapAt(0, 2);
if (less(r[1], r[3])) r.swapAt(1, 3);
if (less(r[0], r[1])) r.swapAt(0, 1);
if (less(r[2], r[3])) r.swapAt(2, 3);

right?

Reply via email to