-
Notifications
You must be signed in to change notification settings - Fork 228
Feature/robust predicates #617
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
Merged
awulkiew
merged 5 commits into
boostorg:develop
from
BoostGSoC19:feature/robust_predicates
Oct 19, 2019
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a39bf3f
Add robust cartesian side and in_circle predicates.
tinko92 0c0f365
Document robust predicates.
tinko92 97f3976
GSoC acknowledgement, unused parameter removal, simplify type selecti…
tinko92 d185633
Merge branch 'develop' of https://github.com/boostorg/geometry into f…
tinko92 e1521a2
Capitalize Robustness parameter, make it std::size_t, simplify docume…
tinko92 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Boost.Geometry (aka GGL, Generic Geometry Library) | ||
| # | ||
| # Use, modification and distribution is subject to the Boost Software License, | ||
| # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | ||
| # http://www.boost.org/LICENSE_1_0.txt) | ||
|
|
||
| test-suite boost-geometry-extensions-triangulation | ||
| : | ||
| [ run side_robust.cpp ] | ||
| [ run in_circle_robust.cpp ] | ||
| ; | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // Boost.Geometry (aka GGL, Generic Geometry Library) | ||
| // Unit Test | ||
|
|
||
| // Copyright (c) 2019 Tinko Bartels, Berlin, Germany. | ||
|
|
||
| // Use, modification and distribution is subject to the Boost Software License, | ||
| // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | ||
| // http://www.boost.org/LICENSE_1_0.txt) | ||
|
|
||
| #include <geometry_test_common.hpp> | ||
|
|
||
| #include <boost/geometry/geometries/point_xy.hpp> | ||
| #include <boost/geometry/extensions/triangulation/strategies/cartesian/in_circle_robust.hpp> | ||
|
|
||
| template <typename P> | ||
| void test_all() | ||
| { | ||
| typedef bg::strategy::in_circle::in_circle_robust<double, 2> inc2; | ||
| typedef bg::strategy::in_circle::in_circle_robust<double, 1> inc1; | ||
| typedef bg::strategy::in_circle::in_circle_robust<double, 0> inc0; | ||
|
|
||
| P col1(0.0, 0.0), col2(1.0, 0.0), col3(0.0, 1.0); | ||
| P in(0.5,0.5) , on(1.0, 0.0), out(-0.5, -0.5); | ||
| int in2 = inc2::apply(col1, col2, col3, in); | ||
| BOOST_CHECK_GT(in2, 0); | ||
| int in1 = inc1::apply(col1, col2, col3, in); | ||
| BOOST_CHECK_GT(in1, 0); | ||
| int in0 = inc0::apply(col1, col2, col3, in); | ||
| BOOST_CHECK_GT(in0, 0); | ||
|
|
||
| int on2 = inc2::apply(col1, col2, col3, on); | ||
| BOOST_CHECK_EQUAL(on2, 0); | ||
| int on1 = inc1::apply(col1, col2, col3, on); | ||
| BOOST_CHECK_EQUAL(on1, 0); | ||
| int on0 = inc0::apply(col1, col2, col3, on); | ||
| BOOST_CHECK_EQUAL(on0, 0); | ||
|
|
||
| int out2 = inc2::apply(col1, col2, col3, out); | ||
| BOOST_CHECK_GT(0, out2); | ||
| int out1 = inc1::apply(col1, col2, col3, out); | ||
| BOOST_CHECK_GT(0, out1); | ||
| int out0 = inc0::apply(col1, col2, col3, out); | ||
| BOOST_CHECK_GT(0, out0); | ||
|
|
||
| P hard1(0, 0), hard2(1e20, 0), hard3(0, 1e20); | ||
| P inhard(0.5, 0.5); | ||
| int hardr = inc2::apply(hard1, hard2, hard3, inhard); | ||
| BOOST_CHECK_GT(hardr, 0); | ||
| } | ||
|
|
||
|
|
||
| int test_main(int, char* []) | ||
| { | ||
| test_all<bg::model::d2::point_xy<double> >(); | ||
| return 0; | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| // Boost.Geometry (aka GGL, Generic Geometry Library) | ||
| // Unit Test | ||
|
|
||
| // Copyright (c) 2019 Tinko Bartels, Berlin, Germany. | ||
|
|
||
| // Use, modification and distribution is subject to the Boost Software License, | ||
| // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | ||
| // http://www.boost.org/LICENSE_1_0.txt) | ||
|
|
||
| #include <geometry_test_common.hpp> | ||
|
|
||
| #include <boost/geometry/geometries/point_xy.hpp> | ||
| #include <boost/geometry/extensions/triangulation/strategies/cartesian/side_robust.hpp> | ||
|
|
||
| template <typename P> | ||
| void test_all() | ||
| { | ||
| typedef bg::strategy::side::side_robust<double, 3> side3; | ||
| typedef bg::strategy::side::side_robust<double, 2> side2; | ||
| typedef bg::strategy::side::side_robust<double, 1> side1; | ||
| typedef bg::strategy::side::side_robust<double, 0> side0; | ||
|
|
||
| P col1(1.0, 1.0), col2(2.0, 2.0), col3(3.0, 3.0); | ||
| int col3r = side3::apply(col1, col2, col3); | ||
| BOOST_CHECK_EQUAL(0, col3r); | ||
| int col2r = side2::apply(col1, col2, col3); | ||
| BOOST_CHECK_EQUAL(0, col2r); | ||
| int col1r = side1::apply(col1, col2, col3); | ||
| BOOST_CHECK_EQUAL(0, col1r); | ||
| int col0r = side0::apply(col1, col2, col3); | ||
| BOOST_CHECK_EQUAL(0, col0r); | ||
|
|
||
| P easy1(0.0, 0.0), easy2(1.0, 1.0), easy3(0.0, 1.0); | ||
| int easy3r = side3::apply(easy1, easy2, easy3); | ||
| BOOST_CHECK_GT(easy3r, 0); | ||
| int easy2r = side2::apply(easy1, easy2, easy3); | ||
| BOOST_CHECK_GT(easy2r, 0); | ||
| int easy1r = side1::apply(easy1, easy2, easy3); | ||
| BOOST_CHECK_GT(easy1r, 0); | ||
| int easy0r = side0::apply(easy1, easy2, easy3); | ||
| BOOST_CHECK_GT(easy0r, 0); | ||
|
|
||
| P medium1(1.0, 1.0), medium2(1.0e20, 1.0e20), medium3(1.0, 2.0); | ||
| int medium3r = side3::apply(medium1, medium2, medium3); | ||
| BOOST_CHECK_GT(medium3r, 0); | ||
| int medium2r = side2::apply(medium1, medium2, medium3); | ||
| BOOST_CHECK_GT(medium2r, 0); | ||
|
|
||
| P hard1(1.0e-20, 1.0e-20), hard2(1.0e20, 1.0e20), hard3(1.0, 2.0); | ||
| int hard3r = side3::apply(hard1, hard2, hard3); | ||
| BOOST_CHECK_GT(hard3r, 0); | ||
| } | ||
|
|
||
|
|
||
| int test_main(int, char* []) | ||
| { | ||
| test_all<bg::model::d2::point_xy<double> >(); | ||
| return 0; | ||
| } |
Oops, something went wrong.
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.
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 could acknowledge GSoC here if you like. See for example https://github.com/boostorg/geometry/blob/develop/include/boost/geometry/formulas/karney_direct.hpp#L5