Boost logo

Boost :

Subject: [boost] [random] fixing uniform_int bias
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-05-25 00:05:44


AMDG

Given that we periodically get complaints about the non-uniformity
of uniform_int, I'm going to commit that attached patch if no one
objects.

I had to modify one of the test cases, because it causes the modified
uniform_int to loop forever. I believe that this is acceptable, because the
test is giving uniform_int a generator that always returns the same
value. The rejection method used currently will also loop under certain
similar circumstances.

The patch also fixes an operator precedence error. However, looking
more closely, there appears to be another bug in that branch, which can
cause a loop. Aaaaaargh. I'll probably get a complete patch sometime
tomorrow, but in the meantime I'd appreciate having another pair
of eyes looking at the fix I have.

In Christ,
Steven Watanabe




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk