From 01f3b7d7721fd3f079df3156a054c37625bb46cb Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Sun, 21 Mar 2021 15:59:36 +0300 Subject: [PATCH] Remove --- .../boost/math/special_functions/expm1.hpp | 5 +- .../boost/math/special_functions/log1p.hpp | 7 ++- include/boost/math/tools/precision.hpp | 61 +++++++++---------- 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/include/boost/math/special_functions/expm1.hpp b/include/boost/math/special_functions/expm1.hpp index ad51e1c6da..a2855e53dd 100644 --- a/include/boost/math/special_functions/expm1.hpp +++ b/include/boost/math/special_functions/expm1.hpp @@ -11,7 +11,8 @@ #endif #include -#include +#include +#include #include #include #include @@ -127,7 +128,7 @@ T expm1_imp(T x, const std::integral_constant&, const Policy& pol) if(a < tools::epsilon()) return x; detail::expm1_series s(x); - boost::uintmax_t max_iter = policies::get_max_series_iterations(); + std::uintmax_t max_iter = policies::get_max_series_iterations(); #if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x582)) && !BOOST_WORKAROUND(__EDG_VERSION__, <= 245) T result = tools::sum_series(s, policies::get_epsilon(), max_iter); #else diff --git a/include/boost/math/special_functions/log1p.hpp b/include/boost/math/special_functions/log1p.hpp index 66b9694971..33e5de08a0 100644 --- a/include/boost/math/special_functions/log1p.hpp +++ b/include/boost/math/special_functions/log1p.hpp @@ -13,7 +13,8 @@ #endif #include -#include +#include +#include #include #include #include @@ -99,7 +100,7 @@ T log1p_imp(T const & x, const Policy& pol, const std::integral_constant if(a < tools::epsilon()) return x; detail::log1p_series s(x); - boost::uintmax_t max_iter = policies::get_max_series_iterations(); + std::uintmax_t max_iter = policies::get_max_series_iterations(); #if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x582)) && !BOOST_WORKAROUND(__EDG_VERSION__, <= 245) result_type result = tools::sum_series(s, policies::get_epsilon(), max_iter); #else @@ -475,7 +476,7 @@ inline typename tools::promote_args::type return -x * x / 2; boost::math::detail::log1p_series s(x); s(); - boost::uintmax_t max_iter = policies::get_max_series_iterations(); + std::uintmax_t max_iter = policies::get_max_series_iterations(); #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x582)) T zero = 0; T result = boost::math::tools::sum_series(s, policies::get_epsilon(), max_iter, zero); diff --git a/include/boost/math/tools/precision.hpp b/include/boost/math/tools/precision.hpp index 9eaa62189e..7e1d2aef29 100644 --- a/include/boost/math/tools/precision.hpp +++ b/include/boost/math/tools/precision.hpp @@ -10,7 +10,6 @@ #pragma once #endif -#include #include #include #include @@ -37,7 +36,7 @@ namespace tools // See Conceptual Requirements for Real Number Types. template -inline BOOST_MATH_CONSTEXPR int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(T)) BOOST_NOEXCEPT +inline constexpr int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(T)) noexcept { static_assert( ::std::numeric_limits::is_specialized, "Type T must be specialized"); static_assert( ::std::numeric_limits::radix == 2 || ::std::numeric_limits::radix == 10, "Type T must have a radix of 2 or 10"); @@ -48,7 +47,7 @@ inline BOOST_MATH_CONSTEXPR int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(T) } template -inline BOOST_MATH_CONSTEXPR T max_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_MATH_NOEXCEPT(T) +inline constexpr T max_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) noexcept(std::is_floating_point::value) { static_assert( ::std::numeric_limits::is_specialized, "Type T must be specialized"); return (std::numeric_limits::max)(); @@ -56,7 +55,7 @@ inline BOOST_MATH_CONSTEXPR T max_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) B // -max_value = -1.79769e+308, max_value = 1.79769e+308. template -inline BOOST_MATH_CONSTEXPR T min_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_MATH_NOEXCEPT(T) +inline constexpr T min_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) noexcept(std::is_floating_point::value) { static_assert( ::std::numeric_limits::is_specialized, "Type T must be specialized"); @@ -73,13 +72,13 @@ namespace detail{ // For type float first: // template -inline BOOST_MATH_CONSTEXPR T log_max_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_MATH_NOEXCEPT(T) +inline constexpr T log_max_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) noexcept(std::is_floating_point::value) { return 88.0f; } template -inline BOOST_MATH_CONSTEXPR T log_min_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_MATH_NOEXCEPT(T) +inline constexpr T log_min_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) noexcept(std::is_floating_point::value) { return -87.0f; } @@ -87,13 +86,13 @@ inline BOOST_MATH_CONSTEXPR T log_min_value(const std::integral_constant -inline BOOST_MATH_CONSTEXPR T log_max_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_MATH_NOEXCEPT(T) +inline constexpr T log_max_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) noexcept(std::is_floating_point::value) { return 709.0; } template -inline BOOST_MATH_CONSTEXPR T log_min_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_MATH_NOEXCEPT(T) +inline constexpr T log_min_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) noexcept(std::is_floating_point::value) { return -708.0; } @@ -101,13 +100,13 @@ inline BOOST_MATH_CONSTEXPR T log_min_value(const std::integral_constant -inline BOOST_MATH_CONSTEXPR T log_max_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_MATH_NOEXCEPT(T) +inline constexpr T log_max_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) noexcept(std::is_floating_point::value) { return 11356.0L; } template -inline BOOST_MATH_CONSTEXPR T log_min_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_MATH_NOEXCEPT(T) +inline constexpr T log_min_value(const std::integral_constant& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) noexcept(std::is_floating_point::value) { return -11355.0L; } @@ -139,14 +138,14 @@ inline T log_min_value(const std::integral_constant& BOOST_MATH_APPEND_E } template -inline BOOST_MATH_CONSTEXPR T epsilon(const std::true_type& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_MATH_NOEXCEPT(T) +inline constexpr T epsilon(const std::true_type& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) noexcept(std::is_floating_point::value) { return std::numeric_limits::epsilon(); } #if defined(__GNUC__) && ((LDBL_MANT_DIG == 106) || (__LDBL_MANT_DIG__ == 106)) template <> -inline BOOST_MATH_CONSTEXPR long double epsilon(const std::true_type& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(long double)) BOOST_MATH_NOEXCEPT(long double) +inline constexpr long double epsilon(const std::true_type& BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(long double)) noexcept(long double) { // numeric_limits on Darwin (and elsewhere) tells lies here: // the issue is that long double on a few platforms is @@ -191,7 +190,7 @@ template struct log_limit_noexcept_traits_imp : public log_lim template struct log_limit_noexcept_traits_imp : public std::integral_constant {}; template -struct log_limit_noexcept_traits : public log_limit_noexcept_traits_imp {}; +struct log_limit_noexcept_traits : public log_limit_noexcept_traits_imp::value> {}; } // namespace detail @@ -201,7 +200,7 @@ struct log_limit_noexcept_traits : public log_limit_noexcept_traits_imp -inline BOOST_MATH_CONSTEXPR T log_max_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_NOEXCEPT_IF(detail::log_limit_noexcept_traits::value) +inline constexpr T log_max_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) noexcept_IF(detail::log_limit_noexcept_traits::value) { #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS return detail::log_max_value(typename detail::log_limit_traits::tag_type()); @@ -214,7 +213,7 @@ inline BOOST_MATH_CONSTEXPR T log_max_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T) } template -inline BOOST_MATH_CONSTEXPR T log_min_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_NOEXCEPT_IF(detail::log_limit_noexcept_traits::value) +inline constexpr T log_min_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) noexcept_IF(detail::log_limit_noexcept_traits::value) { #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS return detail::log_min_value(typename detail::log_limit_traits::tag_type()); @@ -231,7 +230,7 @@ inline BOOST_MATH_CONSTEXPR T log_min_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T) #endif template -inline BOOST_MATH_CONSTEXPR T epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(T)) BOOST_MATH_NOEXCEPT(T) +inline constexpr T epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(T)) noexcept(std::is_floating_point::value) { #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS return detail::epsilon(std::integral_constant::is_specialized>()); @@ -245,25 +244,25 @@ inline BOOST_MATH_CONSTEXPR T epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(T)) namespace detail{ template -inline BOOST_MATH_CONSTEXPR T root_epsilon_imp(const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T root_epsilon_imp(const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(0.00034526698300124390839884978618400831996329879769945L); } template -inline BOOST_MATH_CONSTEXPR T root_epsilon_imp(const T*, const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T root_epsilon_imp(const T*, const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(0.1490116119384765625e-7L); } template -inline BOOST_MATH_CONSTEXPR T root_epsilon_imp(const T*, const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T root_epsilon_imp(const T*, const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(0.32927225399135962333569506281281311031656150598474e-9L); } template -inline BOOST_MATH_CONSTEXPR T root_epsilon_imp(const T*, const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T root_epsilon_imp(const T*, const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(0.1387778780781445675529539585113525390625e-16L); } @@ -284,25 +283,25 @@ inline T root_epsilon_imp(const T*, const std::integral_constant&) } template -inline BOOST_MATH_CONSTEXPR T cbrt_epsilon_imp(const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T cbrt_epsilon_imp(const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(0.0049215666011518482998719164346805794944150447839903L); } template -inline BOOST_MATH_CONSTEXPR T cbrt_epsilon_imp(const T*, const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T cbrt_epsilon_imp(const T*, const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(6.05545445239333906078989272793696693569753008995e-6L); } template -inline BOOST_MATH_CONSTEXPR T cbrt_epsilon_imp(const T*, const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T cbrt_epsilon_imp(const T*, const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(4.76837158203125e-7L); } template -inline BOOST_MATH_CONSTEXPR T cbrt_epsilon_imp(const T*, const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T cbrt_epsilon_imp(const T*, const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(5.7749313854154005630396773604745549542403508090496e-12L); } @@ -323,25 +322,25 @@ inline T cbrt_epsilon_imp(const T*, const std::integral_constant&) } template -inline BOOST_MATH_CONSTEXPR T forth_root_epsilon_imp(const T*, const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T forth_root_epsilon_imp(const T*, const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(0.018581361171917516667460937040007436176452688944747L); } template -inline BOOST_MATH_CONSTEXPR T forth_root_epsilon_imp(const T*, const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T forth_root_epsilon_imp(const T*, const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(0.0001220703125L); } template -inline BOOST_MATH_CONSTEXPR T forth_root_epsilon_imp(const T*, const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T forth_root_epsilon_imp(const T*, const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(0.18145860519450699870567321328132261891067079047605e-4L); } template -inline BOOST_MATH_CONSTEXPR T forth_root_epsilon_imp(const T*, const std::integral_constant&) BOOST_MATH_NOEXCEPT(T) +inline constexpr T forth_root_epsilon_imp(const T*, const std::integral_constant&) noexcept(std::is_floating_point::value) { return static_cast(0.37252902984619140625e-8L); } @@ -371,19 +370,19 @@ struct root_epsilon_traits } template -inline BOOST_MATH_CONSTEXPR T root_epsilon() BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && detail::root_epsilon_traits::has_noexcept) +inline constexpr T root_epsilon() noexcept(std::is_floating_point::value && detail::root_epsilon_traits::has_noexcept) { return detail::root_epsilon_imp(static_cast(0), typename detail::root_epsilon_traits::tag_type()); } template -inline BOOST_MATH_CONSTEXPR T cbrt_epsilon() BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && detail::root_epsilon_traits::has_noexcept) +inline constexpr T cbrt_epsilon() noexcept(std::is_floating_point::value && detail::root_epsilon_traits::has_noexcept) { return detail::cbrt_epsilon_imp(static_cast(0), typename detail::root_epsilon_traits::tag_type()); } template -inline BOOST_MATH_CONSTEXPR T forth_root_epsilon() BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && detail::root_epsilon_traits::has_noexcept) +inline constexpr T forth_root_epsilon() noexcept(std::is_floating_point::value && detail::root_epsilon_traits::has_noexcept) { return detail::forth_root_epsilon_imp(static_cast(0), typename detail::root_epsilon_traits::tag_type()); }