From 6cb20fdf3f3deeb9895b2ed90dc784ca996fa7cc Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Tue, 23 Jul 2024 16:27:34 -0400 Subject: [PATCH] Fix inconsistent force inline warnings for ellint 1 --- .../boost/math/special_functions/ellint_1.hpp | 20 ++++++++++--------- .../boost/math/special_functions/math_fwd.hpp | 2 ++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/boost/math/special_functions/ellint_1.hpp b/include/boost/math/special_functions/ellint_1.hpp index dfc1815f7..f7fbbce40 100644 --- a/include/boost/math/special_functions/ellint_1.hpp +++ b/include/boost/math/special_functions/ellint_1.hpp @@ -1,5 +1,6 @@ // Copyright (c) 2006 Xiaogang Zhang // Copyright (c) 2006 John Maddock +// Copyright (c) 2024 Matt Borland // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -18,6 +19,7 @@ #pragma once #endif +#include #include #include #include @@ -36,13 +38,13 @@ typename tools::promote_args::type ellint_1(T1 k, T2 phi, const Policy& namespace detail{ template -T ellint_k_imp(T k, const Policy& pol, std::integral_constant const&); +BOOST_MATH_FORCEINLINE T ellint_k_imp(T k, const Policy& pol, std::integral_constant const&); template -T ellint_k_imp(T k, const Policy& pol, std::integral_constant const&); +BOOST_MATH_FORCEINLINE T ellint_k_imp(T k, const Policy& pol, std::integral_constant const&); template -T ellint_k_imp(T k, const Policy& pol, std::integral_constant const&); +BOOST_MATH_FORCEINLINE T ellint_k_imp(T k, const Policy& pol, std::integral_constant const&); template -T ellint_k_imp(T k, const Policy& pol, T one_minus_k2); +BOOST_MATH_FORCEINLINE T ellint_k_imp(T k, const Policy& pol, T one_minus_k2); // Elliptic integral (Legendre form) of the first kind template @@ -760,7 +762,7 @@ BOOST_MATH_FORCEINLINE T ellint_k_imp(T k, const Policy& pol, std::integral_cons } template -BOOST_MATH_FORCEINLINE typename tools::promote_args::type ellint_1(T k, const Policy& pol, const std::true_type&) +typename tools::promote_args::type ellint_1(T k, const Policy& pol, const std::true_type&) { typedef typename tools::promote_args::type result_type; typedef typename policies::evaluation::type value_type; @@ -776,7 +778,7 @@ BOOST_MATH_FORCEINLINE typename tools::promote_args::type ellint_1(T k, const } template -BOOST_MATH_FORCEINLINE typename tools::promote_args::type ellint_1(T1 k, T2 phi, const std::false_type&) +typename tools::promote_args::type ellint_1(T1 k, T2 phi, const std::false_type&) { return boost::math::ellint_1(k, phi, policies::policy<>()); } @@ -785,14 +787,14 @@ BOOST_MATH_FORCEINLINE typename tools::promote_args::type ellint_1(T1 k, // Complete elliptic integral (Legendre form) of the first kind template -BOOST_MATH_FORCEINLINE typename tools::promote_args::type ellint_1(T k) +typename tools::promote_args::type ellint_1(T k) { return ellint_1(k, policies::policy<>()); } // Elliptic integral (Legendre form) of the first kind template -BOOST_MATH_FORCEINLINE typename tools::promote_args::type ellint_1(T1 k, T2 phi, const Policy& pol) // LCOV_EXCL_LINE gcc misses this but sees the function body, strange! +typename tools::promote_args::type ellint_1(T1 k, T2 phi, const Policy& pol) // LCOV_EXCL_LINE gcc misses this but sees the function body, strange! { typedef typename tools::promote_args::type result_type; typedef typename policies::evaluation::type value_type; @@ -800,7 +802,7 @@ BOOST_MATH_FORCEINLINE typename tools::promote_args::type ellint_1(T1 k, } template -BOOST_MATH_FORCEINLINE typename tools::promote_args::type ellint_1(T1 k, T2 phi) +typename tools::promote_args::type ellint_1(T1 k, T2 phi) { typedef typename policies::is_policy::type tag_type; return detail::ellint_1(k, phi, tag_type()); diff --git a/include/boost/math/special_functions/math_fwd.hpp b/include/boost/math/special_functions/math_fwd.hpp index 3495416f2..1199d8ca1 100644 --- a/include/boost/math/special_functions/math_fwd.hpp +++ b/include/boost/math/special_functions/math_fwd.hpp @@ -4,6 +4,7 @@ // Copyright Paul A. Bristow 2006. // Copyright John Maddock 2006. +// Copyright Matt Borland 2024 // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. @@ -26,6 +27,7 @@ #include #include #include +#include #include #include // for argument promotion. #include