Automatically generated, fast floating-point predicates#739
Automatically generated, fast floating-point predicates#739tinko92 wants to merge 6 commits intoboostorg:developfrom
Conversation
vissarion
left a comment
There was a problem hiding this comment.
Thanks Tinko, this is very interesting. I have minor comments.
| bg::get<1>(p2), | ||
| bg::get<0>(p), | ||
| bg::get<1>(p)); | ||
| if(sign != bg::detail::generic_robust_predicates::sign_uncertain) |
| } | ||
| }; | ||
|
|
||
| int main(int argc, char** argv) |
There was a problem hiding this comment.
argc, argv are unused, please compile with -Wall since there are a few more unused variables in this PR.
| struct make_filter_impl | ||
| { | ||
| template <typename ExtremaArray, typename ...Reals> | ||
| static Filter apply(const ExtremaArray& extrema, const Reals&... args) |
There was a problem hiding this comment.
const ExtremaArray& should beExtremaArray const&, similar for const ExtremaArray&
| struct make_filter_impl<Filter, End, End> | ||
| { | ||
| template <typename ExtremaArray, typename ...Reals> | ||
| static Filter apply(const ExtremaArray& extrema, const Reals&... args) |
| } | ||
|
|
||
| template <typename ...Reals> | ||
| inline bool update_extrema_check(const Reals&... args) |
| } | ||
|
|
||
| template <typename ...Reals> | ||
| inline void update_extrema(const Reals&... args) |
| typename Arr, | ||
| typename InputArr | ||
| > | ||
| inline Real get_approx(Arr& interim_results, const InputArr& input) |
There was a problem hiding this comment.
usually the output parameter(s) goes after the input parameter(s) in the library
also const InputArr& should be InputArr const&
| >; | ||
|
|
||
| using orient2d = det2x2 | ||
| < |
There was a problem hiding this comment.
why 8 spaces here vs 4 above?
9c51a62 to
4da968e
Compare
|
I have made the following changes to the PR:
The PR now includes a new test-case in https://github.com/BoostGSoC20/geometry/blob/feature/floating_point_filters/extensions/test/generic_robust_predicates/staged.cpp . It illustrates the intended use of the code in this PR. For a given geometric predicate (in the example the side-predicate), an expression type needs to be constructed. Using the expression type and a floating-point calculation type (like double), filters can be constructed from the stage_* files. These filters can be combined into a staged_predicate for usage, for example, in a robust side strategy or any other strategy that can be computed as the sign of a polynomial of floating-point coordinates. The remaining headers are not intended to be used directly and can be considered implementation details. |
This pull request contains the first part of my GSoC 2020 project. This code is still work in progress and there might be changes to the interface before the end of GSoC.
The project aims to implement a number of facilities that allow easy creation of fast and robust geometric floating-point predicates, such as, for example, orientation tests (Boost.Geometry currently has a 2d orientation test in the side-strategy). As of writing this, the pull request contains templates to
I intend to add
The usage of the various templates for the creation of geometric predicates is illustrated in the tests and the example.
This pull request depends on Boost.MP11, which depends on C++11 but has no additional dependencies. The code itself depends on C++14 because of certain constexpr features.