2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

All test batteries pass [ci skip]

This commit is contained in:
Matt Borland
2021-02-18 20:28:23 +03:00
parent 6b945eae39
commit f484c66519
2 changed files with 15 additions and 4 deletions

View File

@@ -409,14 +409,26 @@ private:
using arg_list = mp_list<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13>; using arg_list = mp_list<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13>;
static constexpr std::size_t arg_list_size = mp_size<arg_list>::value; static constexpr std::size_t arg_list_size = mp_size<arg_list>::value;
template<typename A, typename B, bool b>
struct pick_arg
{
using type = A;
};
template<typename A, typename B>
struct pick_arg<A, B, false>
{
using type = mp_at<arg_list, B>;
};
public: public:
using domain_error_type = typename detail::find_arg<arg_list, is_domain_error<mpl::_1>, domain_error<> >::type; using domain_error_type = typename detail::find_arg<arg_list, is_domain_error<mpl::_1>, domain_error<> >::type;
// Now try to calculate the same domain error type using MP11 // Now try to calculate the same domain error type using MP11
using domain_error_fn = mp_quote_trait<is_domain_error>; using domain_error_fn = mp_quote_trait<is_domain_error>;
using domain_error_index = mp_find_if_q<arg_list, domain_error_fn>; using domain_error_index = mp_find_if_q<arg_list, domain_error_fn>;
static constexpr std::size_t domain_error_index_adjusted = domain_error_index::value >= arg_list_size ? domain_error_index::value - 1 : domain_error_index::value; static constexpr bool end = (domain_error_index::value >= arg_list_size);
using new_domain_error_type = typename std::conditional<domain_error_index_adjusted != arg_list_size, mp_at_c<arg_list, domain_error_index_adjusted>, domain_error<>>::type; using new_domain_error_type = typename pick_arg<domain_error<>, domain_error_index, end>::type;
static_assert(std::is_same<domain_error_type, new_domain_error_type>::value, "MP11 is incorrect"); static_assert(std::is_same<domain_error_type, new_domain_error_type>::value, "MP11 is incorrect");

View File

@@ -49,7 +49,7 @@ BOOST_AUTO_TEST_CASE( test_main )
BOOST_CHECK((std::is_same<policy<domain_error<ignore_error> >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((std::is_same<policy<domain_error<ignore_error> >::promote_float_type, policy<>::promote_float_type>::value));
BOOST_CHECK((std::is_same<policy<domain_error<ignore_error> >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((std::is_same<policy<domain_error<ignore_error> >::promote_double_type, policy<>::promote_double_type>::value));
BOOST_CHECK((std::is_same<policy<domain_error<ignore_error> >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); BOOST_CHECK((std::is_same<policy<domain_error<ignore_error> >::discrete_quantile_type, policy<>::discrete_quantile_type>::value));
/*
BOOST_CHECK((std::is_same<policy<pole_error<user_error> >::domain_error_type, policy<>::domain_error_type >::value)); BOOST_CHECK((std::is_same<policy<pole_error<user_error> >::domain_error_type, policy<>::domain_error_type >::value));
BOOST_CHECK((std::is_same<policy<pole_error<user_error> >::pole_error_type, pole_error<user_error> >::value)); BOOST_CHECK((std::is_same<policy<pole_error<user_error> >::pole_error_type, pole_error<user_error> >::value));
BOOST_CHECK((std::is_same<policy<pole_error<user_error> >::overflow_error_type, overflow_error<BOOST_MATH_OVERFLOW_ERROR_POLICY> >::value)); BOOST_CHECK((std::is_same<policy<pole_error<user_error> >::overflow_error_type, overflow_error<BOOST_MATH_OVERFLOW_ERROR_POLICY> >::value));
@@ -169,7 +169,6 @@ BOOST_AUTO_TEST_CASE( test_main )
BOOST_CHECK((std::is_same<policy<discrete_quantile<integer_round_up> >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((std::is_same<policy<discrete_quantile<integer_round_up> >::promote_float_type, policy<>::promote_float_type>::value));
BOOST_CHECK((std::is_same<policy<discrete_quantile<integer_round_up> >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((std::is_same<policy<discrete_quantile<integer_round_up> >::promote_double_type, policy<>::promote_double_type>::value));
BOOST_CHECK((std::is_same<policy<discrete_quantile<integer_round_up> >::discrete_quantile_type, discrete_quantile<integer_round_up> >::value)); BOOST_CHECK((std::is_same<policy<discrete_quantile<integer_round_up> >::discrete_quantile_type, discrete_quantile<integer_round_up> >::value));
*/
} // BOOST_AUTO_TEST_CASE( test_main ) } // BOOST_AUTO_TEST_CASE( test_main )