Skip to content
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

Use fp_equals comparison in side_strategy for convex_hull. #1209

Merged

Conversation

tinko92
Copy link
Contributor

@tinko92 tinko92 commented Oct 16, 2023

This changes the default side strategy for convex_hull for cartesian coordinates so that it uses an exact comparison to zero for the side value. This is IMHO the only way to use that strategy to guarantee exact (and thereby consistent) results, which was the intention behind the strategy. The motivation is issue #1208 , which is fixed by this change. I see no testcase breaking.

From git blame, I don't see the motivation for the current non-exact comparison. If it was to be more lenient in is_convex, which uses the same umbrella strategy, then maybe those should be separate umbrella strategies. I think in the construction of the hull this non-robustness is more problematic. If it was done like this to avoid near-collinear points on edges of the output, maybe there should be a separate iteration over the hull after construction with another side-strategy.

@atalon-lip6
Copy link

I can confirm it solves a case where Boost was not including one point with maximum x-coordinates in the convex hull.

Copy link
Member

@vissarion vissarion left a comment

Choose a reason for hiding this comment

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

Thanks, I agree with this change. I also verified that all test are passing.

@vissarion
Copy link
Member

Let's wait for @barendgehrels to approve, who has been involved in those changes of robust and non robust strategies.

Copy link
Collaborator

@barendgehrels barendgehrels left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. I'm OK

@vissarion vissarion merged commit 98fdf71 into boostorg:develop Feb 13, 2024
23 checks passed
@vissarion vissarion added this to the 1.85 milestone Feb 13, 2024
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.

4 participants