From 29bb20b4d2e28e7cae3e3fb993cba00a06c6d524 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Sat, 13 Mar 2021 17:25:30 +0300 Subject: [PATCH] Fix local special_fun test failures --- .../detail/bernoulli_details.hpp | 11 ++++---- .../special_functions/detail/polygamma.hpp | 27 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/boost/math/special_functions/detail/bernoulli_details.hpp b/include/boost/math/special_functions/detail/bernoulli_details.hpp index f1c461506..33dc38ecc 100644 --- a/include/boost/math/special_functions/detail/bernoulli_details.hpp +++ b/include/boost/math/special_functions/detail/bernoulli_details.hpp @@ -9,12 +9,12 @@ #include #include -#include #include #include #include #include #include +#include namespace boost{ namespace math{ namespace detail{ // @@ -130,14 +130,15 @@ std::size_t b2n_overflow_limit() // so to compute the Bernoulli numbers from the tangent numbers, we need to avoid spurious // overflow in the calculation, we can do this by scaling all the tangent number by some scale factor: // -template -inline typename enable_if_c::is_specialized && (std::numeric_limits::radix == 2), T>::type tangent_scale_factor() +template ::is_specialized && (std::numeric_limits::radix == 2), bool>::type = true> +inline T tangent_scale_factor() { BOOST_MATH_STD_USING return ldexp(T(1), std::numeric_limits::min_exponent + 5); } -template -inline typename disable_if_c::is_specialized && (std::numeric_limits::radix == 2), T>::type tangent_scale_factor() + +template ::is_specialized || !(std::numeric_limits::radix == 2), bool>::type = true> +inline T tangent_scale_factor() { return tools::min_value() * 16; } diff --git a/include/boost/math/special_functions/detail/polygamma.hpp b/include/boost/math/special_functions/detail/polygamma.hpp index 256df330a..350550fe3 100644 --- a/include/boost/math/special_functions/detail/polygamma.hpp +++ b/include/boost/math/special_functions/detail/polygamma.hpp @@ -12,18 +12,17 @@ #define _BOOST_POLYGAMMA_DETAIL_2013_07_30_HPP_ #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef _MSC_VER #pragma once @@ -403,8 +402,8 @@ namespace boost { namespace math { namespace detail{ if((unsigned)n / 2u > policies::get_max_series_iterations()) return policies::raise_evaluation_error(function, "The value of n is so large that we're unable to compute the result in reasonable time, best guess is %1%", 0, pol); #ifdef BOOST_HAS_THREADS - static boost::detail::lightweight_mutex m; - boost::detail::lightweight_mutex::scoped_lock l(m); + static std::mutex m; + std::lock_guard l(m); #endif static int digits = tools::digits(); static std::vector > table(1, std::vector(1, T(-1)));