Patch simple alias table algorithm
Patch simple alias table algorithm

Patch simple alias table algorithm in a minimally disruptive way, with
an explicit index for the highest or lowest bin, and breaking away when
no such bin is found (aliasing is then complete). Note that the "i"
index (looping n-1 times) is a counter, not an index, which makes the
logic unclear.

The parent commit resolved the sample failure case (10, 10, 1, 1), but
this is coincidental and the code remains fragile, because there is no
distinction between failing to find a high (or low) bin, and exhausting
the corresponding loop. Therefore spurious aliasing might be performed,
despite all bins being already equalized. In the reported failure case
this triggered an aliasing of the last bin with itself.

crcrewso/EGSnrc,ftessier/EGSnrc,nrc-cnrc/EGSnrc,crcrewso/EGSnrc,ftessier/EGSnrc,nrc-cnrc/EGSnrc,MartinMartinov/EGSnrc,MartinMartinov/EGSnrc,ftessier/EGSnrc,nrc-cnrc/EGSnrc,crcrewso/EGSnrc,ftessier/EGSnrc,crcrewso/EGSnrc,MartinMartinov/EGSnrc,MartinMartinov/EGSnrc,mchamberland/EGSnrc,nrc-cnrc/EGSnrc,mchamberland/EGSnrc,MartinMartinov/EGSnrc,nrc-cnrc/EGSnrc,mchamberland/EGSnrc,mchamberland/EGSnrc,ftessier/EGSnrc,ftessier/EGSnrc,mchamberland/EGSnrc,mchamberland/EGSnrc,crcrewso/EGSnrc