From 5c02c0fbead6cacdf970f2db80738271e94b1bed Mon Sep 17 00:00:00 2001 From: Jacob Hass Date: Thu, 1 Oct 2026 19:54:07 -0700 Subject: [PATCH 1/5] Clean up redundant code --- .../quadrature/detail/gauss_quadrature.hpp | 62 ++++++++++++++++++ include/boost/math/quadrature/gauss.hpp | 43 +------------ .../boost/math/quadrature/gauss_hermite.hpp | 63 ++++--------------- 3 files changed, 76 insertions(+), 92 deletions(-) create mode 100644 include/boost/math/quadrature/detail/gauss_quadrature.hpp diff --git a/include/boost/math/quadrature/detail/gauss_quadrature.hpp b/include/boost/math/quadrature/detail/gauss_quadrature.hpp new file mode 100644 index 0000000000..8d631f2d0d --- /dev/null +++ b/include/boost/math/quadrature/detail/gauss_quadrature.hpp @@ -0,0 +1,62 @@ +// Copyright John Maddock 2015. +// 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) + + +#ifndef BOOST_MATH_QUADRATURE_DETAIL_GAUSS_QUADRATURE_HPP +#define BOOST_MATH_QUADRATURE_DETAIL_GAUSS_QUADRATURE_HPP + +#ifndef BOOST_MATH_BUILD_MODULE +#include +#include +#endif + +namespace boost { namespace math{ namespace quadrature{ namespace detail { + +template +struct gauss_constant_category +{ + static const unsigned value = + (std::numeric_limits::is_specialized == 0) ? 999 : + (std::numeric_limits::radix == 2) ? + ( +#ifdef BOOST_HAS_FLOAT128 + (std::numeric_limits::digits <= 113) && std::is_constructible::value ? 0 : +#else + (std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value ? 0 : +#endif + (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999 + ) : (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999; + + using storage_type = + std::conditional_t<(std::numeric_limits::is_specialized == 0), T, + std::conditional_t<(std::numeric_limits::radix == 2), + std::conditional_t< ((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), + float, + std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), + double, + std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), + long double, +#ifdef BOOST_HAS_FLOAT128 + std::conditional_t<((std::numeric_limits::digits <= 113) && std::is_constructible::value), + __float128, + T + > + > +#else + T + > +#endif + > + >, T + > + >; +}; + +} +} +} +} + +#endif // BOOST_MATH_QUADRATURE_DETAIL_GAUSS_QUADRATURE_HPP \ No newline at end of file diff --git a/include/boost/math/quadrature/gauss.hpp b/include/boost/math/quadrature/gauss.hpp index a85dc2ea77..e84c6ccc9f 100644 --- a/include/boost/math/quadrature/gauss.hpp +++ b/include/boost/math/quadrature/gauss.hpp @@ -16,53 +16,14 @@ #endif #include #include +#include #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4127) #endif -namespace boost { namespace math{ namespace quadrature{ namespace detail{ - -template -struct gauss_constant_category -{ - static const unsigned value = - (std::numeric_limits::is_specialized == 0) ? 999 : - (std::numeric_limits::radix == 2) ? - ( -#ifdef BOOST_HAS_FLOAT128 - (std::numeric_limits::digits <= 113) && std::is_constructible::value ? 0 : -#else - (std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value ? 0 : -#endif - (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999 - ) : (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999; - - using storage_type = - std::conditional_t<(std::numeric_limits::is_specialized == 0), T, - std::conditional_t<(std::numeric_limits::radix == 2), - std::conditional_t< ((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), - float, - std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), - double, - std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), - long double, -#ifdef BOOST_HAS_FLOAT128 - std::conditional_t<((std::numeric_limits::digits <= 113) && std::is_constructible::value), - __float128, - T - > - > -#else - T - > -#endif - > - >, T - > - >; -}; +namespace boost { namespace math{ namespace quadrature{ namespace detail { #ifndef BOOST_MATH_GAUSS_NO_COMPUTE_ON_DEMAND diff --git a/include/boost/math/quadrature/gauss_hermite.hpp b/include/boost/math/quadrature/gauss_hermite.hpp index bfa40dd165..5bd9ccf9d6 100644 --- a/include/boost/math/quadrature/gauss_hermite.hpp +++ b/include/boost/math/quadrature/gauss_hermite.hpp @@ -32,49 +32,10 @@ #include #include #include +#include namespace boost { namespace math { namespace quadrature { namespace detail { -template -struct gauss_hermite_constant_category -{ - static const unsigned value = - (std::numeric_limits::is_specialized == 0) ? 999 : - (std::numeric_limits::radix == 2) ? - ( -#ifdef BOOST_HAS_FLOAT128 - (std::numeric_limits::digits <= 113) && std::is_constructible::value ? 0 : -#else - (std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value ? 0 : -#endif - (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999 - ) : (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999; - - using storage_type = - std::conditional_t<(std::numeric_limits::is_specialized == 0), T, - std::conditional_t<(std::numeric_limits::radix == 2), - std::conditional_t< ((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), - float, - std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), - double, - std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), - long double, -#ifdef BOOST_HAS_FLOAT128 - std::conditional_t<((std::numeric_limits::digits <= 113) && std::is_constructible::value), - __float128, - T - > - > -#else - T - > -#endif - > - >, T - > - >; -}; - #ifndef BOOST_MATH_GAUSS_NO_COMPUTE_ON_DEMAND template @@ -252,7 +213,7 @@ class gauss_hermite_detail; template class gauss_hermite_detail { - using storage_type = typename gauss_hermite_constant_category::storage_type; + using storage_type = typename gauss_constant_category::storage_type; public: static std::array const & abscissa() { @@ -280,7 +241,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_hermite_constant_category::storage_type; + using storage_type = typename gauss_constant_category::storage_type; public: static std::array const & abscissa() { @@ -308,7 +269,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_hermite_constant_category::storage_type; + using storage_type = typename gauss_constant_category::storage_type; public: static std::array const & abscissa() { @@ -336,7 +297,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_hermite_constant_category::storage_type; + using storage_type = typename gauss_constant_category::storage_type; public: static std::array const & abscissa() { @@ -366,7 +327,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_hermite_constant_category::storage_type; + using storage_type = typename gauss_constant_category::storage_type; public: static std::array const & abscissa() { @@ -396,7 +357,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_hermite_constant_category::storage_type; + using storage_type = typename gauss_constant_category::storage_type; public: static std::array const & abscissa() { @@ -426,7 +387,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_hermite_constant_category::storage_type; + using storage_type = typename gauss_constant_category::storage_type; public: static std::array const & abscissa() { @@ -462,7 +423,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_hermite_constant_category::storage_type; + using storage_type = typename gauss_constant_category::storage_type; public: static std::array const & abscissa() { @@ -498,7 +459,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_hermite_constant_category::storage_type; + using storage_type = typename gauss_constant_category::storage_type; public: static std::array const & abscissa() { @@ -533,9 +494,9 @@ class gauss_hermite_detail } // namespace detail template > -class gauss_hermite : public detail::gauss_hermite_detail::value> +class gauss_hermite : public detail::gauss_hermite_detail::value> { - using base = detail::gauss_hermite_detail::value>; + using base = detail::gauss_hermite_detail::value>; // Abscissas computed on demand are NaN when the recurrence overflows Real. static bool overflowed() From 9c710466c679f640b4323b710cf927a13b0b42aa Mon Sep 17 00:00:00 2001 From: Jacob Hass Date: Fri, 2 Oct 2026 08:56:17 -0700 Subject: [PATCH 2/5] Changed naming convention --- .../quadrature/detail/gauss_quadrature.hpp | 62 ------------------- include/boost/math/quadrature/gauss.hpp | 30 ++++----- .../boost/math/quadrature/gauss_hermite.hpp | 24 +++---- .../boost/math/quadrature/gauss_kronrod.hpp | 29 ++++----- 4 files changed, 42 insertions(+), 103 deletions(-) delete mode 100644 include/boost/math/quadrature/detail/gauss_quadrature.hpp diff --git a/include/boost/math/quadrature/detail/gauss_quadrature.hpp b/include/boost/math/quadrature/detail/gauss_quadrature.hpp deleted file mode 100644 index 8d631f2d0d..0000000000 --- a/include/boost/math/quadrature/detail/gauss_quadrature.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright John Maddock 2015. -// 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) - - -#ifndef BOOST_MATH_QUADRATURE_DETAIL_GAUSS_QUADRATURE_HPP -#define BOOST_MATH_QUADRATURE_DETAIL_GAUSS_QUADRATURE_HPP - -#ifndef BOOST_MATH_BUILD_MODULE -#include -#include -#endif - -namespace boost { namespace math{ namespace quadrature{ namespace detail { - -template -struct gauss_constant_category -{ - static const unsigned value = - (std::numeric_limits::is_specialized == 0) ? 999 : - (std::numeric_limits::radix == 2) ? - ( -#ifdef BOOST_HAS_FLOAT128 - (std::numeric_limits::digits <= 113) && std::is_constructible::value ? 0 : -#else - (std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value ? 0 : -#endif - (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999 - ) : (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999; - - using storage_type = - std::conditional_t<(std::numeric_limits::is_specialized == 0), T, - std::conditional_t<(std::numeric_limits::radix == 2), - std::conditional_t< ((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), - float, - std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), - double, - std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), - long double, -#ifdef BOOST_HAS_FLOAT128 - std::conditional_t<((std::numeric_limits::digits <= 113) && std::is_constructible::value), - __float128, - T - > - > -#else - T - > -#endif - > - >, T - > - >; -}; - -} -} -} -} - -#endif // BOOST_MATH_QUADRATURE_DETAIL_GAUSS_QUADRATURE_HPP \ No newline at end of file diff --git a/include/boost/math/quadrature/gauss.hpp b/include/boost/math/quadrature/gauss.hpp index e84c6ccc9f..8478580fff 100644 --- a/include/boost/math/quadrature/gauss.hpp +++ b/include/boost/math/quadrature/gauss.hpp @@ -16,7 +16,7 @@ #endif #include #include -#include +#include #ifdef _MSC_VER #pragma warning(push) @@ -64,7 +64,7 @@ class gauss_detail; template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -91,7 +91,7 @@ class gauss_detail template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -144,7 +144,7 @@ class gauss_detail template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -173,7 +173,7 @@ class gauss_detail template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -231,7 +231,7 @@ class gauss_detail template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -266,7 +266,7 @@ class gauss_detail template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -336,7 +336,7 @@ class gauss_detail template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -375,7 +375,7 @@ class gauss_detail template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -453,7 +453,7 @@ class gauss_detail template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -498,7 +498,7 @@ class gauss_detail template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -589,7 +589,7 @@ class gauss_detail template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -638,7 +638,7 @@ class gauss_detail template class gauss_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -735,9 +735,9 @@ class gauss_detail } BOOST_MATH_EXPORT template > -class gauss : public detail::gauss_detail::value> +class gauss : public detail::gauss_detail::value> { - typedef detail::gauss_detail::value> base; + typedef detail::gauss_detail::value> base; public: template diff --git a/include/boost/math/quadrature/gauss_hermite.hpp b/include/boost/math/quadrature/gauss_hermite.hpp index 5bd9ccf9d6..9be907beed 100644 --- a/include/boost/math/quadrature/gauss_hermite.hpp +++ b/include/boost/math/quadrature/gauss_hermite.hpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include namespace boost { namespace math { namespace quadrature { namespace detail { @@ -213,7 +213,7 @@ class gauss_hermite_detail; template class gauss_hermite_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -241,7 +241,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -269,7 +269,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -297,7 +297,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -327,7 +327,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -357,7 +357,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -387,7 +387,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -423,7 +423,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -459,7 +459,7 @@ class gauss_hermite_detail template class gauss_hermite_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -494,9 +494,9 @@ class gauss_hermite_detail } // namespace detail template > -class gauss_hermite : public detail::gauss_hermite_detail::value> +class gauss_hermite : public detail::gauss_hermite_detail::value> { - using base = detail::gauss_hermite_detail::value>; + using base = detail::gauss_hermite_detail::value>; // Abscissas computed on demand are NaN when the recurrence overflows Real. static bool overflowed() diff --git a/include/boost/math/quadrature/gauss_kronrod.hpp b/include/boost/math/quadrature/gauss_kronrod.hpp index 05a2066ac4..3f1c5cab81 100644 --- a/include/boost/math/quadrature/gauss_kronrod.hpp +++ b/include/boost/math/quadrature/gauss_kronrod.hpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace boost { namespace math{ namespace quadrature{ namespace detail{ @@ -88,7 +89,7 @@ class gauss_kronrod_detail; template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -124,7 +125,7 @@ class gauss_kronrod_detail template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -196,7 +197,7 @@ class gauss_kronrod_detail template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -238,7 +239,7 @@ class gauss_kronrod_detail template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -322,7 +323,7 @@ class gauss_kronrod_detail template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -375,7 +376,7 @@ class gauss_kronrod_detail template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -479,7 +480,7 @@ class gauss_kronrod_detail template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -542,7 +543,7 @@ class gauss_kronrod_detail template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -666,7 +667,7 @@ class gauss_kronrod_detail template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -739,7 +740,7 @@ class gauss_kronrod_detail template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -883,7 +884,7 @@ class gauss_kronrod_detail template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -966,7 +967,7 @@ class gauss_kronrod_detail template class gauss_kronrod_detail { - using storage_type = typename gauss_constant_category::storage_type; + using storage_type = typename quadrature_constant_category::storage_type; public: static std::array const & abscissa() { @@ -1128,9 +1129,9 @@ class gauss_kronrod_detail } BOOST_MATH_EXPORT template > -class gauss_kronrod : public detail::gauss_kronrod_detail::value> +class gauss_kronrod : public detail::gauss_kronrod_detail::value> { - typedef detail::gauss_kronrod_detail::value> base; + typedef detail::gauss_kronrod_detail::value> base; public: typedef Real value_type; private: From 03b3217b4066e2e8652a69599974639f2e096329 Mon Sep 17 00:00:00 2001 From: Jacob Hass Date: Fri, 2 Oct 2026 09:12:25 -0700 Subject: [PATCH 3/5] Added file --- .../quadrature/detail/quadrature_constant.hpp | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 include/boost/math/quadrature/detail/quadrature_constant.hpp diff --git a/include/boost/math/quadrature/detail/quadrature_constant.hpp b/include/boost/math/quadrature/detail/quadrature_constant.hpp new file mode 100644 index 0000000000..81dabee7eb --- /dev/null +++ b/include/boost/math/quadrature/detail/quadrature_constant.hpp @@ -0,0 +1,62 @@ +// Copyright John Maddock 2015. +// 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) + + +#ifndef BOOST_MATH_QUADRATURE_DETAIL_QUADRATURE_CONSTANT_HPP +#define BOOST_MATH_QUADRATURE_DETAIL_QUADRATURE_CONSTANT_HPP + +#ifndef BOOST_MATH_BUILD_MODULE +#include +#include +#endif + +namespace boost { namespace math{ namespace quadrature{ namespace detail { + +template +struct quadrature_constant_category +{ + static const unsigned value = + (std::numeric_limits::is_specialized == 0) ? 999 : + (std::numeric_limits::radix == 2) ? + ( +#ifdef BOOST_HAS_FLOAT128 + (std::numeric_limits::digits <= 113) && std::is_constructible::value ? 0 : +#else + (std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value ? 0 : +#endif + (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999 + ) : (std::numeric_limits::digits10 <= 110) && std::is_constructible::value ? 4 : 999; + + using storage_type = + std::conditional_t<(std::numeric_limits::is_specialized == 0), T, + std::conditional_t<(std::numeric_limits::radix == 2), + std::conditional_t< ((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), + float, + std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), + double, + std::conditional_t<((std::numeric_limits::digits <= std::numeric_limits::digits) && std::is_constructible::value), + long double, +#ifdef BOOST_HAS_FLOAT128 + std::conditional_t<((std::numeric_limits::digits <= 113) && std::is_constructible::value), + __float128, + T + > + > +#else + T + > +#endif + > + >, T + > + >; +}; + +} +} +} +} + +#endif // BOOST_MATH_QUADRATURE_DETAIL_QUADRATURE_CONSTANT_HPP \ No newline at end of file From 0587197d92394ca11996e2043de956d2ae9ee912 Mon Sep 17 00:00:00 2001 From: Jacob Hass Date: Sat, 3 Oct 2026 19:54:56 -0700 Subject: [PATCH 4/5] Fixed namespace --- .../boost/math/quadrature/detail/quadrature_constant.hpp | 9 ++++----- include/boost/math/quadrature/gauss.hpp | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/boost/math/quadrature/detail/quadrature_constant.hpp b/include/boost/math/quadrature/detail/quadrature_constant.hpp index 81dabee7eb..ea09288a9d 100644 --- a/include/boost/math/quadrature/detail/quadrature_constant.hpp +++ b/include/boost/math/quadrature/detail/quadrature_constant.hpp @@ -12,7 +12,7 @@ #include #endif -namespace boost { namespace math{ namespace quadrature{ namespace detail { +BOOST_MATH_NAMESPACE_BEGIN namespace quadrature{ namespace detail { template struct quadrature_constant_category @@ -54,9 +54,8 @@ struct quadrature_constant_category >; }; -} -} -} -} +} // namespace detail +} // namespace quadrature +BOOST_MATH_NAMESPACE_END #endif // BOOST_MATH_QUADRATURE_DETAIL_QUADRATURE_CONSTANT_HPP \ No newline at end of file diff --git a/include/boost/math/quadrature/gauss.hpp b/include/boost/math/quadrature/gauss.hpp index f5e9bc41f9..5fc600b5fc 100644 --- a/include/boost/math/quadrature/gauss.hpp +++ b/include/boost/math/quadrature/gauss.hpp @@ -23,7 +23,7 @@ #pragma warning(disable:4127) #endif -namespace boost { namespace math{ namespace quadrature{ namespace detail { +BOOST_MATH_NAMESPACE_BEGIN namespace quadrature{ namespace detail { #ifndef BOOST_MATH_GAUSS_NO_COMPUTE_ON_DEMAND From 8f40d8e07b8b771214645d08e008e65f1addf3a2 Mon Sep 17 00:00:00 2001 From: Jacob Hass Date: Sun, 4 Oct 2026 10:28:34 -0700 Subject: [PATCH 5/5] Fixed remaining namespaces --- include/boost/math/quadrature/gauss.hpp | 2 +- include/boost/math/quadrature/gauss_hermite.hpp | 2 +- include/boost/math/quadrature/gauss_kronrod.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/math/quadrature/gauss.hpp b/include/boost/math/quadrature/gauss.hpp index 5fc600b5fc..6d12cfdc75 100644 --- a/include/boost/math/quadrature/gauss.hpp +++ b/include/boost/math/quadrature/gauss.hpp @@ -734,7 +734,7 @@ class gauss_detail } -BOOST_MATH_EXPORT template > +BOOST_MATH_EXPORT template > class gauss : public detail::gauss_detail::value> { typedef detail::gauss_detail::value> base; diff --git a/include/boost/math/quadrature/gauss_hermite.hpp b/include/boost/math/quadrature/gauss_hermite.hpp index 2a0acae7e2..2330983a7a 100644 --- a/include/boost/math/quadrature/gauss_hermite.hpp +++ b/include/boost/math/quadrature/gauss_hermite.hpp @@ -493,7 +493,7 @@ class gauss_hermite_detail } // namespace detail -template > +template > class gauss_hermite : public detail::gauss_hermite_detail::value> { using base = detail::gauss_hermite_detail::value>; diff --git a/include/boost/math/quadrature/gauss_kronrod.hpp b/include/boost/math/quadrature/gauss_kronrod.hpp index 19080d1005..f66b9de5d0 100644 --- a/include/boost/math/quadrature/gauss_kronrod.hpp +++ b/include/boost/math/quadrature/gauss_kronrod.hpp @@ -1128,7 +1128,7 @@ class gauss_kronrod_detail } -BOOST_MATH_EXPORT template > +BOOST_MATH_EXPORT template > class gauss_kronrod : public detail::gauss_kronrod_detail::value> { typedef detail::gauss_kronrod_detail::value> base;