X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=boost%2Fmath%2Fpolicies%2Fpolicy.hpp;h=24334c7d0457810edbf30ed1b18015736241c68c;hp=b66cd7f9239b05097b5552627ad29fb2d4660641;hb=2d71eb92104693ca9baa5a2e1c23eeca776d8fd3;hpb=da57529b92adbb7ae74a89861cb39fb35ac7c62d diff --git a/boost/math/policies/policy.hpp b/boost/math/policies/policy.hpp index b66cd7f..24334c7 100644 --- a/boost/math/policies/policy.hpp +++ b/boost/math/policies/policy.hpp @@ -431,7 +431,7 @@ public: // // Mathematically undefined properties: // - typedef typename detail::find_arg, discrete_quantile<> >::type assert_undefined_type; + typedef typename detail::find_arg, assert_undefined<> >::type assert_undefined_type; // // Max iterations: // @@ -537,12 +537,12 @@ private: // // Mathematically undefined properties: // - typedef typename detail::find_arg, discrete_quantile<> >::type assert_undefined_type; + typedef typename detail::find_arg, typename Policy::assert_undefined_type >::type assert_undefined_type; // // Max iterations: // - typedef typename detail::find_arg, max_series_iterations<> >::type max_series_iterations_type; - typedef typename detail::find_arg, max_root_iterations<> >::type max_root_iterations_type; + typedef typename detail::find_arg, typename Policy::max_series_iterations_type>::type max_series_iterations_type; + typedef typename detail::find_arg, typename Policy::max_root_iterations_type>::type max_root_iterations_type; // // Define a typelist of the policies: // @@ -738,6 +738,7 @@ struct basic_digits : public mpl::int_{ }; template struct precision { + BOOST_STATIC_ASSERT( ::std::numeric_limits::radix == 2); typedef typename Policy::precision_type precision_type; typedef basic_digits digits_t; typedef typename mpl::if_< @@ -775,6 +776,7 @@ struct precision template struct precision { + BOOST_STATIC_ASSERT((::std::numeric_limits::radix == 2) || ((::std::numeric_limits::is_specialized == 0) || (::std::numeric_limits::digits == 0))); #ifndef __BORLANDC__ typedef typename Policy::precision_type precision_type; typedef typename mpl::if_c< @@ -811,6 +813,16 @@ struct precision #endif +#ifdef BOOST_MATH_USE_FLOAT128 + +template +struct precision<__float128, Policy> +{ + typedef mpl::int_<113> type; +}; + +#endif + namespace detail{ template @@ -896,8 +908,10 @@ inline T get_epsilon_imp(mpl::true_ const&) { #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS BOOST_STATIC_ASSERT( ::std::numeric_limits::is_specialized); + BOOST_STATIC_ASSERT( ::std::numeric_limits::radix == 2); #else BOOST_ASSERT(::std::numeric_limits::is_specialized); + BOOST_ASSERT(::std::numeric_limits::radix == 2); #endif typedef typename boost::math::policies::precision::type p_t; typedef mpl::bool_::digits> is_small_int; @@ -916,7 +930,7 @@ inline T get_epsilon_imp(mpl::false_ const&) template inline T get_epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) { - typedef mpl::bool_< std::numeric_limits::is_specialized > tag_type; + typedef mpl::bool_< (std::numeric_limits::is_specialized && (std::numeric_limits::radix == 2)) > tag_type; return detail::get_epsilon_imp(tag_type()); } @@ -947,6 +961,29 @@ struct is_policy_imp template struct is_policy : public mpl::bool_< ::boost::math::policies::detail::is_policy_imp

::value> {}; +// +// Helper traits class for distribution error handling: +// +template +struct constructor_error_check +{ + typedef typename Policy::domain_error_type domain_error_type; + typedef typename mpl::if_c< + (domain_error_type::value == throw_on_error) || (domain_error_type::value == user_error), + mpl::true_, + mpl::false_>::type type; +}; + +template +struct method_error_check +{ + typedef typename Policy::domain_error_type domain_error_type; + typedef typename mpl::if_c< + (domain_error_type::value == throw_on_error) && (domain_error_type::value != user_error), + mpl::false_, + mpl::true_>::type type; +}; + }}} // namespaces #endif // BOOST_MATH_POLICY_HPP