Skip to content

Commit

Permalink
Improvements to type passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
tinko92 committed Aug 26, 2020
1 parent aa2afbc commit 4da968e
Show file tree
Hide file tree
Showing 7 changed files with 304 additions and 209 deletions.
11 changes: 7 additions & 4 deletions extensions/test/generic_robust_predicates/approximate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void test_all()
using bg::detail::generic_robust_predicates::approximate_value;
using bg::detail::generic_robust_predicates::get_approx;
using bg::detail::generic_robust_predicates::approximate_interim;
using bg::detail::generic_robust_predicates::argument_list;
using ct = CalculationType;
ct r1 = approximate_value<sum<_1, _2>, ct>(
std::array<ct, 2>{1.0, 2.0});
Expand All @@ -47,14 +48,16 @@ void test_all()
difference<_3, _4>
>;
using evals = post_order<expression>;
using arg_list_input = argument_list<4>;
using arg_list = boost::mp11::mp_list<evals, arg_list_input>;
std::array<ct, boost::mp11::mp_size<evals>::value> r;
std::array<ct, 4> input {5.0, 3.0, 2.0, 8.0};
approximate_interim<evals, evals, ct>(r, input);
ct r3 = get_approx<evals, typename expression::left, ct>(r, input);
approximate_interim<evals, arg_list, ct>(r, input);
ct r3 = get_approx<typename expression::left, arg_list, ct>(r, input);
BOOST_CHECK_EQUAL(2.0, r3);
ct r4 = get_approx<evals, typename expression::right, ct>(r, input);
ct r4 = get_approx<typename expression::right, arg_list, ct>(r, input);
BOOST_CHECK_EQUAL(-6.0, r4);
ct r5 = get_approx<evals, expression, ct>(r, input);
ct r5 = get_approx<expression, arg_list, ct>(r, input);
BOOST_CHECK_EQUAL(-12.0, r5);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class almost_static_filter
extrema_array m_extrema;
StaticFilter m_filter;
public:
static constexpr std::size_t arg_count = StaticFilter::arg_count;
const StaticFilter& filter() const { return m_filter; }
inline almost_static_filter()
{
Expand Down
Loading

0 comments on commit 4da968e

Please sign in to comment.