Skip to content

Conversation

jszuppe
Copy link
Contributor

@jszuppe jszuppe commented Apr 24, 2016

Related to #587.

Now generated floating-point values are uniformly distributed on the interval [a, b) and no value is greater or equal to b.

I also added test that checks if results are in fact in [a,b) range (by using range_test_engine class that generates max random value or zeroes).

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 88.821% when pulling 5a987fe on haahh:pr_fix_uni_real_dist into 48217d2 on boostorg:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 88.808% when pulling 5a987fe on haahh:pr_fix_uni_real_dist into 48217d2 on boostorg:develop.

@jszuppe
Copy link
Contributor Author

jszuppe commented Apr 25, 2016

Travis-CI tests failed only because of find_end algorithm. It's fixed by #597.

// initialize the range_test_engine
range_test_engine<boost::compute::uint_> engine(queue);

// setup the uniform distribution to produce floats between 1 and 100
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

jszuppe added 3 commits April 25, 2016 19:43
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).
@jszuppe jszuppe force-pushed the pr_fix_uni_real_dist branch from 5a987fe to 8aea290 Compare April 25, 2016 17:46
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 88.808% when pulling 8aea290 on haahh:pr_fix_uni_real_dist into 8e5151a on boostorg:develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants