Robust, integer crosses for is_straight_line_drawing#442
Merged
jeremy-murphy merged 1 commit intoboostorg:developfrom Nov 30, 2025
Merged
Conversation
Contributor
|
After all, this is probably the best way to go. Thank you so much for the thorough analysis and implementation. |
…y in is_straight_line_drawing.hpp.
257f595 to
ac16714
Compare
Contributor
Author
|
Ah, I forgot. Added the dependency and squashed it into one commit. Since I am not so familiar with the boost build system and its cmake setup, the following two completed without error on my machine from the boost top-level directory after adding the dependency (for testing): ./b2 --with-graph -j8
cmake -S . -B build -DBOOST_INCLUDE_LIBRARIES=graph && cmake --build build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR, based on what I propose in boostorg/geometry#1434, drops the use of Boost.Geometry in is_straight_line_drawing.hpp in favour of a simple, int128-based test. This drops the dependency on Boost.Geometry and adds a dependency on Boost.Multiprecision (which would otherwise come transitively through BG):
This new test makes the assumption that coordinate values are integers.
It has the following semantics (If I didn't miss something) based on my understanding of the definition of planar drawing (non-parallel edges meet only at shared endpoints):
If any change to this is desired, I can edit.
It should have the following robustness properties:
Performance properties:
Tests run successfully (except isomorphism which also fails on develop for me due to cannot open file) on my device but its CPU is non-x86.