From 1d7afe18f7707fa0a4a7c7b8bf7dab4cd748a488 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 23 Oct 2025 13:21:55 +0200 Subject: [PATCH] Fix undefined types with new GCC --- .../math/interpolators/cubic_hermite.hpp | 7 ++++--- .../detail/barycentric_rational_detail.hpp | 15 ++++++------- .../cardinal_quintic_b_spline_detail.hpp | 21 ++++++++++--------- .../detail/cubic_hermite_detail.hpp | 7 ++++--- .../detail/quintic_hermite_detail.hpp | 7 ++++--- .../detail/septic_hermite_detail.hpp | 7 ++++--- .../vector_barycentric_rational_detail.hpp | 15 ++++++------- .../math/interpolators/quintic_hermite.hpp | 7 ++++--- .../math/interpolators/septic_hermite.hpp | 7 ++++--- 9 files changed, 51 insertions(+), 42 deletions(-) diff --git a/include/boost/math/interpolators/cubic_hermite.hpp b/include/boost/math/interpolators/cubic_hermite.hpp index 48346ab1e..04d1fa787 100644 --- a/include/boost/math/interpolators/cubic_hermite.hpp +++ b/include/boost/math/interpolators/cubic_hermite.hpp @@ -8,6 +8,7 @@ #define BOOST_MATH_INTERPOLATORS_CUBIC_HERMITE_HPP #include #include +#include namespace boost { namespace math { @@ -41,7 +42,7 @@ public: impl_->push_back(x, y, dydx); } - int64_t bytes() const + std::int64_t bytes() const { return impl_->bytes() + sizeof(impl_); } @@ -80,7 +81,7 @@ public: return os; } - int64_t bytes() const + std::int64_t bytes() const { return impl_->bytes() + sizeof(impl_); } @@ -121,7 +122,7 @@ public: return os; } - int64_t bytes() const + std::int64_t bytes() const { return impl_->bytes() + sizeof(impl_); } diff --git a/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp b/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp index a363e1861..004bf3f9b 100644 --- a/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp +++ b/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp @@ -12,6 +12,7 @@ #include // for std::move #include // for std::is_sorted #include +#include #include #include @@ -100,22 +101,22 @@ template void barycentric_rational_imp::calculate_weights(size_t approximation_order) { using std::abs; - int64_t n = m_x.size(); + std::int64_t n = m_x.size(); m_w.resize(n, 0); - for(int64_t k = 0; k < n; ++k) + for(std::int64_t k = 0; k < n; ++k) { - int64_t i_min = (std::max)(k - static_cast(approximation_order), static_cast(0)); - int64_t i_max = k; + std::int64_t i_min = (std::max)(k - static_cast(approximation_order), static_cast(0)); + std::int64_t i_max = k; if (k >= n - (std::ptrdiff_t)approximation_order) { i_max = n - approximation_order - 1; } - for(int64_t i = i_min; i <= i_max; ++i) + for(std::int64_t i = i_min; i <= i_max; ++i) { Real inv_product = 1; - int64_t j_max = (std::min)(static_cast(i + approximation_order), static_cast(n - 1)); - for(int64_t j = i; j <= j_max; ++j) + std::int64_t j_max = (std::min)(static_cast(i + approximation_order), static_cast(n - 1)); + for(std::int64_t j = i; j <= j_max; ++j) { if (j == k) { diff --git a/include/boost/math/interpolators/detail/cardinal_quintic_b_spline_detail.hpp b/include/boost/math/interpolators/detail/cardinal_quintic_b_spline_detail.hpp index f189e79dd..fcaa33661 100644 --- a/include/boost/math/interpolators/detail/cardinal_quintic_b_spline_detail.hpp +++ b/include/boost/math/interpolators/detail/cardinal_quintic_b_spline_detail.hpp @@ -7,6 +7,7 @@ #ifndef BOOST_MATH_INTERPOLATORS_CARDINAL_QUINTIC_B_SPLINE_DETAIL_HPP #define BOOST_MATH_INTERPOLATORS_CARDINAL_QUINTIC_B_SPLINE_DETAIL_HPP #include +#include #include #include #include @@ -157,7 +158,7 @@ public: m_alpha[n+3] = rhs[n+3]/diagonal[n+3]; m_alpha[n+2] = rhs[n+2] - first_superdiagonal[n+2]*m_alpha[n+3]; - for (int64_t i = int64_t(n+1); i >= 0; --i) { + for (std::int64_t i = std::int64_t(n+1); i >= 0; --i) { m_alpha[i] = rhs[i] - first_superdiagonal[i]*m_alpha[i+1] - second_superdiagonal[i]*m_alpha[i+2]; } @@ -176,10 +177,10 @@ public: Real x = (t-m_t0)*m_inv_h; // Support of B_5 is [-3, 3]. So -3 < x - j + 2 < 3, so x-1 < j < x+5. // TODO: Zero pad m_alpha so that only the domain check is necessary. - int64_t j_min = (std::max)(int64_t(0), int64_t(ceil(x-1))); - int64_t j_max = (std::min)(int64_t(m_alpha.size() - 1), int64_t(floor(x+5)) ); + std::int64_t j_min = (std::max)(std::int64_t(0), std::int64_t(ceil(x-1))); + std::int64_t j_max = (std::min)(std::int64_t(m_alpha.size() - 1), std::int64_t(floor(x+5)) ); Real s = 0; - for (int64_t j = j_min; j <= j_max; ++j) { + for (std::int64_t j = j_min; j <= j_max; ++j) { // TODO: Use Cox 1972 to generate all integer translates of B5 simultaneously. s += m_alpha[j]*cardinal_b_spline<5, Real>(x - j + 2); } @@ -196,10 +197,10 @@ public: } Real x = (t-m_t0)*m_inv_h; // Support of B_5 is [-3, 3]. So -3 < x - j + 2 < 3, so x-1 < j < x+5 - int64_t j_min = (std::max)(int64_t(0), int64_t(ceil(x-1))); - int64_t j_max = (std::min)(int64_t(m_alpha.size() - 1), int64_t(floor(x+5)) ); + std::int64_t j_min = (std::max)(std::int64_t(0), std::int64_t(ceil(x-1))); + std::int64_t j_max = (std::min)(std::int64_t(m_alpha.size() - 1), std::int64_t(floor(x+5)) ); Real s = 0; - for (int64_t j = j_min; j <= j_max; ++j) { + for (std::int64_t j = j_min; j <= j_max; ++j) { s += m_alpha[j]*cardinal_b_spline_prime<5, Real>(x - j + 2); } return s*m_inv_h; @@ -216,10 +217,10 @@ public: } Real x = (t-m_t0)*m_inv_h; // Support of B_5 is [-3, 3]. So -3 < x - j + 2 < 3, so x-1 < j < x+5 - int64_t j_min = (std::max)(int64_t(0), int64_t(ceil(x-1))); - int64_t j_max = (std::min)(int64_t(m_alpha.size() - 1), int64_t(floor(x+5)) ); + std::int64_t j_min = (std::max)(std::int64_t(0), std::int64_t(ceil(x-1))); + std::int64_t j_max = (std::min)(std::int64_t(m_alpha.size() - 1), std::int64_t(floor(x+5)) ); Real s = 0; - for (int64_t j = j_min; j <= j_max; ++j) { + for (std::int64_t j = j_min; j <= j_max; ++j) { s += m_alpha[j]*cardinal_b_spline_double_prime<5, Real>(x - j + 2); } return s*m_inv_h*m_inv_h; diff --git a/include/boost/math/interpolators/detail/cubic_hermite_detail.hpp b/include/boost/math/interpolators/detail/cubic_hermite_detail.hpp index 921902e1f..0e04d3739 100644 --- a/include/boost/math/interpolators/detail/cubic_hermite_detail.hpp +++ b/include/boost/math/interpolators/detail/cubic_hermite_detail.hpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace boost { namespace math { @@ -154,7 +155,7 @@ public: return x_.size(); } - int64_t bytes() const + std::int64_t bytes() const { return 3*x_.size()*sizeof(Real) + 3*sizeof(x_); } @@ -278,7 +279,7 @@ public: return y_.size(); } - int64_t bytes() const + std::int64_t bytes() const { return 2*y_.size()*sizeof(Real) + 2*sizeof(y_) + 2*sizeof(Real); } @@ -413,7 +414,7 @@ public: return dat_.size(); } - int64_t bytes() const + std::int64_t bytes() const { return dat_.size()*dat_[0].size()*sizeof(Real) + sizeof(dat_) + 2*sizeof(Real); } diff --git a/include/boost/math/interpolators/detail/quintic_hermite_detail.hpp b/include/boost/math/interpolators/detail/quintic_hermite_detail.hpp index 50c1b85ea..ad7eee13a 100644 --- a/include/boost/math/interpolators/detail/quintic_hermite_detail.hpp +++ b/include/boost/math/interpolators/detail/quintic_hermite_detail.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace boost { namespace math { @@ -193,7 +194,7 @@ public: return os; } - int64_t bytes() const + std::int64_t bytes() const { return 4*x_.size()*sizeof(x_); } @@ -380,7 +381,7 @@ public: return d2ydx2; } - int64_t bytes() const + std::int64_t bytes() const { return 3*y_.size()*sizeof(Real) + 2*sizeof(Real); } @@ -561,7 +562,7 @@ public: return d2ydx2; } - int64_t bytes() const + std::int64_t bytes() const { return data_.size()*data_[0].size()*sizeof(Real) + 2*sizeof(Real); } diff --git a/include/boost/math/interpolators/detail/septic_hermite_detail.hpp b/include/boost/math/interpolators/detail/septic_hermite_detail.hpp index 47d155561..f4677ce0b 100644 --- a/include/boost/math/interpolators/detail/septic_hermite_detail.hpp +++ b/include/boost/math/interpolators/detail/septic_hermite_detail.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace boost { namespace math { @@ -189,7 +190,7 @@ public: return os; } - int64_t bytes() + std::int64_t bytes() { return 5*x_.size()*sizeof(Real) + 5*sizeof(x_); } @@ -419,7 +420,7 @@ public: return d2ydx2; } - int64_t bytes() const + std::int64_t bytes() const { return 4*y_.size()*sizeof(Real) + 2*sizeof(Real) + 4*sizeof(y_); } @@ -629,7 +630,7 @@ public: return d2ydx2; } - int64_t bytes() const + std::int64_t bytes() const { return data_.size()*data_[0].size()*sizeof(Real) + 2*sizeof(Real) + sizeof(data_); } diff --git a/include/boost/math/interpolators/detail/vector_barycentric_rational_detail.hpp b/include/boost/math/interpolators/detail/vector_barycentric_rational_detail.hpp index f4650784b..fdece724c 100644 --- a/include/boost/math/interpolators/detail/vector_barycentric_rational_detail.hpp +++ b/include/boost/math/interpolators/detail/vector_barycentric_rational_detail.hpp @@ -8,6 +8,7 @@ #ifndef BOOST_MATH_INTERPOLATORS_VECTOR_BARYCENTRIC_RATIONAL_DETAIL_HPP #define BOOST_MATH_INTERPOLATORS_VECTOR_BARYCENTRIC_RATIONAL_DETAIL_HPP +#include #include #include #include // for std::move @@ -64,22 +65,22 @@ void vector_barycentric_rational_imp::calculate_w { using Real = typename TimeContainer::value_type; using std::abs; - int64_t n = t_.size(); + std::int64_t n = t_.size(); w_.resize(n, Real(0)); - for(int64_t k = 0; k < n; ++k) + for(std::int64_t k = 0; k < n; ++k) { - int64_t i_min = (std::max)(k - static_cast(approximation_order), static_cast(0)); - int64_t i_max = k; + std::int64_t i_min = (std::max)(k - static_cast(approximation_order), static_cast(0)); + std::int64_t i_max = k; if (k >= n - (std::ptrdiff_t)approximation_order) { i_max = n - approximation_order - 1; } - for(int64_t i = i_min; i <= i_max; ++i) + for(std::int64_t i = i_min; i <= i_max; ++i) { Real inv_product = 1; - int64_t j_max = (std::min)(static_cast(i + approximation_order), static_cast(n - 1)); - for(int64_t j = i; j <= j_max; ++j) + std::int64_t j_max = (std::min)(static_cast(i + approximation_order), static_cast(n - 1)); + for(std::int64_t j = i; j <= j_max; ++j) { if (j == k) { diff --git a/include/boost/math/interpolators/quintic_hermite.hpp b/include/boost/math/interpolators/quintic_hermite.hpp index c0ba067de..1c00b1546 100644 --- a/include/boost/math/interpolators/quintic_hermite.hpp +++ b/include/boost/math/interpolators/quintic_hermite.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include namespace boost { @@ -50,7 +51,7 @@ public: impl_->push_back(x, y, dydx, d2ydx2); } - int64_t bytes() const + std::int64_t bytes() const { return impl_->bytes() + sizeof(impl_); } @@ -85,7 +86,7 @@ public: return impl_->double_prime(x); } - int64_t bytes() const + std::int64_t bytes() const { return impl_->bytes() + sizeof(impl_); } @@ -123,7 +124,7 @@ public: return impl_->double_prime(x); } - int64_t bytes() const + std::int64_t bytes() const { return impl_->bytes() + sizeof(impl_); } diff --git a/include/boost/math/interpolators/septic_hermite.hpp b/include/boost/math/interpolators/septic_hermite.hpp index f428a7651..e8cb8e549 100644 --- a/include/boost/math/interpolators/septic_hermite.hpp +++ b/include/boost/math/interpolators/septic_hermite.hpp @@ -9,6 +9,7 @@ #include #include #include +#include #include namespace boost { @@ -47,7 +48,7 @@ public: return os; } - int64_t bytes() const + std::int64_t bytes() const { return impl_->bytes() + sizeof(impl_); } @@ -87,7 +88,7 @@ public: return impl_->double_prime(x); } - int64_t bytes() const + std::int64_t bytes() const { return impl_->bytes() + sizeof(impl_); } @@ -126,7 +127,7 @@ public: return impl_->double_prime(x); } - int64_t bytes() const + std::int64_t bytes() const { return impl_.size() + sizeof(impl_); }