-
Notifications
You must be signed in to change notification settings - Fork 338
Fix uniform real distribution #595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Travis-CI tests failed only because of |
// initialize the range_test_engine | ||
range_test_engine<boost::compute::uint_> engine(queue); | ||
|
||
// setup the uniform distribution to produce floats between 1 and 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be between 0.9
and 1.0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right! I'll fix this in a minute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Now generated floating-point values are uniformly distributed on the interval [a, b). Before this commit it was possible to produce values equal to b.
New test checks if values generated by uniform real distribution are in the [a,b) interval.
Making sure that the left endpoint (a) of the range in uniform real distribution is less than the right endpoint (b).
5a987fe
to
8aea290
Compare
Related to #587.
Now generated floating-point values are uniformly distributed on the interval
[a, b)
and no value is greater or equal tob
.I also added test that checks if results are in fact in
[a,b)
range (by usingrange_test_engine
class that generates max random value or zeroes).