-
Notifications
You must be signed in to change notification settings - Fork 113
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
Fix overflow edge case in sequence of balls volume method #228
Conversation
rnum-1 is passed into RandomPointGenerator::apply a few lines later
Codecov Report
@@ Coverage Diff @@
## develop #228 +/- ##
========================================
Coverage 55.24% 55.24%
========================================
Files 85 85
Lines 4802 4802
Branches 2108 2109 +1
========================================
Hits 2653 2653
Misses 896 896
Partials 1253 1253
|
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.
Thanks @dymil for this PR! I am OK with merging of this change but please add the edge cases you mention in the test suite (this will eventually increase the coverage, notice that the CI is complaining about coverage decrease).
You can add tests here https://github.com/GeomScale/volesti/blob/develop/test/volume_sob_hpolytope.cpp for (sequence of balls volume algorithm) |
a23ab66
to
a2e152a
Compare
Force rnum>=2 rather than >=1, so that all three walk methods succeed for 1D case. Small rnum's due to larger error or n_threads may fail in other ways in higher dimensions, e.g., empty balls check
I added a 1D test case which fails (times out) with the old code but passes with the updated (after tweaking the fix to ensure Alternative fixes which might be more suitable include shrinking n_threads if needed ( |
Force rnum>=1, avoiding integer overflow when rnum-1 is passed into RandomPointGenerator::apply a few lines later, which hoovers up RAM and time. This edge case can be observed with a degenerate polytope (I tried a 1D interval) or with extreme choices of
error
andn_threads
.