On 02/18/2013 03:35 PM, Ivan Kazmenko wrote:
I wonder what is the use case of std.random.randomCover when one has
std.random.randomShuffle.  I was trying to use it just to get a random
permutation of integers, and found randomCover prior to randomShuffle.  However,
for the number of elements as low as 10,000, the delay was already rather
surprising, so I searched for a faster solution and found randomShuffle does a
superior job.  And now I wonder: how does one correctly use randomCover? Below
is a sample test program showing the difference.

Surely, because randomShuffle is re-ordering the elements in-place, whereas randomCover is not.

Reply via email to