https://d.puremagic.com/issues/show_bug.cgi?id=5849
--- Comment #10 from bearophile_h...@eml.cc 2013-11-22 04:43:56 PST --- See also: http://www.keithschwarz.com/interesting/code/?dir=alias-method Once paid the time to create the range, all the successive popFront() become just something like this (where for speed nextDouble is not a call to uniform(), but it's more like uniform01): int column = random.nextInt(probability.length); boolean coinToss = random.nextDouble() < probability[column]; return coinToss ? column : alias[column]; -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------