order bias in flex.random_permutation
Dear cctbx developers, I happened to notice that the implementation of flex.random_permutation (scitbx/random.h) results in biased order because each element is always swapped with the element randomly selected from entire range of array. For details, please see the second paragraph and the right figure of http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Implementation_err... I reproduced the plot using flex.random_permutation. Actually this seems to have less impact because flex.random_permutation is rarely used in cctbx or phenix as far as I know. If needed, I would commit the corrected version (using the algorithm in the wikipedia article above). Best regards, Keitaro
On Thu, Sep 11, 2014 at 3:59 AM, Keitaro Yamashita < [email protected]> wrote:
If needed, I would commit the corrected version (using the algorithm in the wikipedia article above).
This is fine with me but it probably needs to pass the full regression tests. If it passes all of the built-in tests (e.g. run_tests.py in each module) that's a good sign but please send me the patch and I will run the remainder of tests here. thanks, Nat
participants (2)
-
Keitaro Yamashita
-
Nathaniel Echols