update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -11,9 +11,11 @@
#ifndef BOOST_MATH_DISTRIBUTION_CONCEPT_HPP
#define BOOST_MATH_DISTRIBUTION_CONCEPT_HPP
#ifndef BOOST_MATH_STANDALONE
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/fwd.hpp>
#ifdef BOOST_MSVC
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4100)
#pragma warning(disable: 4510)
@@ -21,7 +23,7 @@
#pragma warning(disable: 4189) // local variable is initialized but not referenced.
#endif
#include <boost/concept_check.hpp>
#ifdef BOOST_MSVC
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <utility>
@@ -47,8 +49,8 @@ public:
// but we need a way to instantiate the archetype:
static distribution_archetype& get_object()
{
// will never get caled:
return *reinterpret_cast<distribution_archetype*>(0);
// will never get called:
return *reinterpret_cast<distribution_archetype*>(nullptr);
}
}; // template <class RealType>class distribution_archetype
@@ -112,7 +114,7 @@ std::pair<RealType, RealType> support(const distribution_archetype<RealType>& di
//
// Next comes the concept checks for verifying that a class
// fullfils the requirements of a Distribution:
// fulfils the requirements of a Distribution:
//
template <class Distribution>
struct DistributionConcept
@@ -487,5 +489,9 @@ Distribution* DistributionConcept<Distribution>::pd = 0;
} // namespace math
} // namespace boost
#else
#error This header can not be used in standalone mode.
#endif // BOOST_MATH_STANDALONE
#endif // BOOST_MATH_DISTRIBUTION_CONCEPT_HPP

View File

@@ -23,13 +23,12 @@
#ifndef BOOST_MATH_REAL_CONCEPT_HPP
#define BOOST_MATH_REAL_CONCEPT_HPP
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/math/special_functions/trunc.hpp>
#include <boost/math/special_functions/modf.hpp>
#include <boost/math/tools/big_constant.hpp>
#include <boost/math/tools/precision.hpp>
#include <boost/math/tools/config.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/math/special_functions/asinh.hpp>
#include <boost/math/special_functions/atanh.hpp>
@@ -38,13 +37,18 @@
#endif
#include <ostream>
#include <istream>
#include <boost/config/no_tr1/cmath.hpp>
#include <math.h> // fmodl
#include <limits>
#include <cmath>
#include <cstdint>
#if defined(__SGI_STL_PORT) || defined(_RWSTD_VER) || defined(__LIBCOMO__)
# include <cstdio>
#endif
#if __has_include(<stdfloat>)
# include <stdfloat>
#endif
namespace boost{ namespace math{
namespace concepts
@@ -62,9 +66,7 @@ public:
// Constructors:
real_concept() : m_value(0){}
real_concept(char c) : m_value(c){}
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
real_concept(wchar_t c) : m_value(c){}
#endif
real_concept(unsigned char c) : m_value(c){}
real_concept(signed char c) : m_value(c){}
real_concept(unsigned short c) : m_value(c){}
@@ -73,43 +75,43 @@ public:
real_concept(int c) : m_value(c){}
real_concept(unsigned long c) : m_value(c){}
real_concept(long c) : m_value(c){}
#if defined(__DECCXX) || defined(__SUNPRO_CC)
real_concept(unsigned long long c) : m_value(static_cast<real_concept_base_type>(c)){}
real_concept(long long c) : m_value(static_cast<real_concept_base_type>(c)){}
#elif defined(BOOST_HAS_LONG_LONG)
real_concept(boost::ulong_long_type c) : m_value(static_cast<real_concept_base_type>(c)){}
real_concept(boost::long_long_type c) : m_value(static_cast<real_concept_base_type>(c)){}
#elif defined(BOOST_HAS_MS_INT64)
real_concept(unsigned __int64 c) : m_value(static_cast<real_concept_base_type>(c)){}
real_concept(__int64 c) : m_value(static_cast<real_concept_base_type>(c)){}
#endif
real_concept(float c) : m_value(c){}
real_concept(double c) : m_value(c){}
real_concept(long double c) : m_value(c){}
#ifdef BOOST_MATH_USE_FLOAT128
real_concept(BOOST_MATH_FLOAT128_TYPE c) : m_value(c){}
#endif
#ifdef __STDCPP_FLOAT32_T__
real_concept(std::float32_t c) : m_value(static_cast<real_concept_base_type>(c)){}
#endif
#ifdef __STDCPP_FLOAT64_T__
real_concept(std::float64_t c) : m_value(static_cast<real_concept_base_type>(c)){}
#endif
// Assignment:
real_concept& operator=(char c) { m_value = c; return *this; }
real_concept& operator=(unsigned char c) { m_value = c; return *this; }
real_concept& operator=(signed char c) { m_value = c; return *this; }
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
real_concept& operator=(wchar_t c) { m_value = c; return *this; }
#endif
real_concept& operator=(short c) { m_value = c; return *this; }
real_concept& operator=(unsigned short c) { m_value = c; return *this; }
real_concept& operator=(int c) { m_value = c; return *this; }
real_concept& operator=(unsigned int c) { m_value = c; return *this; }
real_concept& operator=(long c) { m_value = c; return *this; }
real_concept& operator=(unsigned long c) { m_value = c; return *this; }
#ifdef BOOST_HAS_LONG_LONG
real_concept& operator=(boost::long_long_type c) { m_value = static_cast<real_concept_base_type>(c); return *this; }
real_concept& operator=(boost::ulong_long_type c) { m_value = static_cast<real_concept_base_type>(c); return *this; }
#endif
real_concept& operator=(long long c) { m_value = static_cast<real_concept_base_type>(c); return *this; }
real_concept& operator=(unsigned long long c) { m_value = static_cast<real_concept_base_type>(c); return *this; }
real_concept& operator=(float c) { m_value = c; return *this; }
real_concept& operator=(double c) { m_value = c; return *this; }
real_concept& operator=(long double c) { m_value = c; return *this; }
#ifdef __STDCPP_FLOAT32_T__
real_concept& operator=(std::float32_t c) { m_value = c; return *this; }
#endif
#ifdef __STDCPP_FLOAT64_T__
real_concept& operator=(std::float64_t c) { m_value = c; return *this; }
#endif
// Access:
real_concept_base_type value()const{ return m_value; }
@@ -289,13 +291,11 @@ inline long lround(const concepts::real_concept& v, const Policy& pol)
inline long lround(const concepts::real_concept& v)
{ return boost::math::lround(v.value(), policies::policy<>()); }
#ifdef BOOST_HAS_LONG_LONG
template <class Policy>
inline boost::long_long_type llround(const concepts::real_concept& v, const Policy& pol)
inline long long llround(const concepts::real_concept& v, const Policy& pol)
{ return boost::math::llround(v.value(), pol); }
inline boost::long_long_type llround(const concepts::real_concept& v)
inline long long llround(const concepts::real_concept& v)
{ return boost::math::llround(v.value(), policies::policy<>()); }
#endif
template <class Policy>
inline int itrunc(const concepts::real_concept& v, const Policy& pol)
@@ -308,13 +308,11 @@ inline long ltrunc(const concepts::real_concept& v, const Policy& pol)
inline long ltrunc(const concepts::real_concept& v)
{ return boost::math::ltrunc(v.value(), policies::policy<>()); }
#ifdef BOOST_HAS_LONG_LONG
template <class Policy>
inline boost::long_long_type lltrunc(const concepts::real_concept& v, const Policy& pol)
inline long long lltrunc(const concepts::real_concept& v, const Policy& pol)
{ return boost::math::lltrunc(v.value(), pol); }
inline boost::long_long_type lltrunc(const concepts::real_concept& v)
inline long long lltrunc(const concepts::real_concept& v)
{ return boost::math::lltrunc(v.value(), policies::policy<>()); }
#endif
// Streaming:
template <class charT, class traits>
@@ -325,28 +323,10 @@ inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, t
template <class charT, class traits>
inline std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, traits>& is, real_concept& a)
{
#if defined(BOOST_MSVC) && defined(__SGI_STL_PORT)
//
// STLPort 5.1.4 has a problem reading long doubles from strings,
// see http://sourceforge.net/tracker/index.php?func=detail&aid=1811043&group_id=146814&atid=766244
//
double v;
is >> v;
a = v;
return is;
#elif defined(__SGI_STL_PORT) || defined(_RWSTD_VER) || defined(__LIBCOMO__) || defined(_LIBCPP_VERSION)
std::string s;
real_concept_base_type d;
is >> s;
std::sscanf(s.c_str(), "%Lf", &d);
a = d;
return is;
#else
real_concept_base_type v;
is >> v;
a = v;
return is;
#endif
}
} // namespace concepts
@@ -355,7 +335,7 @@ namespace tools
{
template <>
inline concepts::real_concept make_big_value<concepts::real_concept>(boost::math::tools::largest_float val, const char* , mpl::false_ const&, mpl::false_ const&)
inline concepts::real_concept make_big_value<concepts::real_concept>(boost::math::tools::largest_float val, const char* , std::false_type const&, std::false_type const&)
{
return val; // Can't use lexical_cast here, sometimes it fails....
}
@@ -395,7 +375,7 @@ inline concepts::real_concept epsilon<concepts::real_concept>(BOOST_MATH_EXPLICI
}
template <>
inline BOOST_MATH_CONSTEXPR int digits<concepts::real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::real_concept)) BOOST_NOEXCEPT
inline constexpr int digits<concepts::real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::real_concept)) noexcept
{
// Assume number of significand bits is same as real_concept_base_type,
// unless std::numeric_limits<T>::is_specialized to provide digits.
@@ -408,88 +388,6 @@ inline BOOST_MATH_CONSTEXPR int digits<concepts::real_concept>(BOOST_MATH_EXPLIC
}
} // namespace tools
/*
namespace policies {
namespace detail {
template <class T>
inline concepts::real_concept raise_rounding_error(
const char*,
const char*,
const T& val,
const concepts::real_concept&,
const ::boost::math::policies::rounding_error< ::boost::math::policies::errno_on_error>&) BOOST_MATH_NOEXCEPT(T)
{
errno = ERANGE;
// This may or may not do the right thing, but the user asked for the error
// to be silent so here we go anyway:
return val > 0 ? boost::math::tools::max_value<concepts::real_concept>() : -boost::math::tools::max_value<concepts::real_concept>();
}
}
}*/
#if defined(__SGI_STL_PORT) || defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
//
// We shouldn't really need these type casts any more, but there are some
// STLport iostream bugs we work around by using them....
//
namespace tools
{
// real_cast converts from T to integer and narrower floating-point types.
// Convert from T to integer types.
template <>
inline unsigned int real_cast<unsigned int, concepts::real_concept>(concepts::real_concept r)
{
return static_cast<unsigned int>(r.value());
}
template <>
inline int real_cast<int, concepts::real_concept>(concepts::real_concept r)
{
return static_cast<int>(r.value());
}
template <>
inline long real_cast<long, concepts::real_concept>(concepts::real_concept r)
{
return static_cast<long>(r.value());
}
// Converts from T to narrower floating-point types, float, double & long double.
template <>
inline float real_cast<float, concepts::real_concept>(concepts::real_concept r)
{
return static_cast<float>(r.value());
}
template <>
inline double real_cast<double, concepts::real_concept>(concepts::real_concept r)
{
return static_cast<double>(r.value());
}
template <>
inline long double real_cast<long double, concepts::real_concept>(concepts::real_concept r)
{
return r.value();
}
} // STLPort
#endif
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
//
// For some strange reason ADL sometimes fails to find the
// correct overloads, unless we bring these declarations into scope:
//
using concepts::itrunc;
using concepts::iround;
#endif
} // namespace math
} // namespace boost

View File

@@ -6,15 +6,14 @@
#ifndef BOOST_MATH_REAL_TYPE_CONCEPT_HPP
#define BOOST_MATH_REAL_TYPE_CONCEPT_HPP
#include <boost/config.hpp>
#ifdef BOOST_MSVC
#include <cmath>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4100)
#pragma warning(disable: 4510)
#pragma warning(disable: 4610)
#endif
#include <boost/concept_check.hpp>
#ifdef BOOST_MSVC
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <boost/math/tools/config.hpp>
@@ -27,7 +26,7 @@ template <class RealType>
struct RealTypeConcept
{
template <class Other>
void check_binary_ops(Other o)
void check_binary_ops(Other o) const
{
RealType r(o);
r = o;
@@ -83,9 +82,7 @@ struct RealTypeConcept
//check_binary_ops(1u);
check_binary_ops(1L);
//check_binary_ops(1uL);
#ifndef BOOST_HAS_LONG_LONG
check_binary_ops(1LL);
#endif
RealType r2 = +r;
r2 = -r;
@@ -103,7 +100,7 @@ struct RealTypeConcept
r2 = asin(r);
r2 = acos(r);
r2 = atan(r);
int i;
int i {};
r2 = ldexp(r, i);
r2 = frexp(r, &i);
i = boost::math::tools::digits<RealType>();

View File

@@ -16,15 +16,12 @@
// A template instantiated with std_real_concept will *only*
// compile if it std::whatever is in scope.
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include <limits>
#include <ostream>
#include <istream>
#include <boost/config/no_tr1/cmath.hpp>
#include <math.h> // fmodl
#include <cmath>
#ifndef BOOST_MATH_STD_REAL_CONCEPT_HPP
#define BOOST_MATH_STD_REAL_CONCEPT_HPP
@@ -60,10 +57,9 @@ public:
#if defined(__DECCXX) || defined(__SUNPRO_CC)
std_real_concept(unsigned long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
std_real_concept(long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
#elif defined(BOOST_HAS_LONG_LONG)
std_real_concept(boost::ulong_long_type c) : m_value(static_cast<std_real_concept_base_type>(c)){}
std_real_concept(boost::long_long_type c) : m_value(static_cast<std_real_concept_base_type>(c)){}
#endif
std_real_concept(unsigned long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
std_real_concept(long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
std_real_concept(float c) : m_value(c){}
std_real_concept(double c) : m_value(c){}
std_real_concept(long double c) : m_value(c){}
@@ -87,10 +83,10 @@ public:
#if defined(__DECCXX) || defined(__SUNPRO_CC)
std_real_concept& operator=(unsigned long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
std_real_concept& operator=(long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
#elif defined(BOOST_HAS_LONG_LONG)
std_real_concept& operator=(boost::long_long_type c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
std_real_concept& operator=(boost::ulong_long_type c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
#endif
std_real_concept& operator=(long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
std_real_concept& operator=(unsigned long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
std_real_concept& operator=(float c) { m_value = c; return *this; }
std_real_concept& operator=(double c) { m_value = c; return *this; }
std_real_concept& operator=(long double c) { m_value = c; return *this; }
@@ -277,20 +273,16 @@ inline long lround(const concepts::std_real_concept& v)
return boost::math::lround(v.value(), policies::policy<>());
}
#ifdef BOOST_HAS_LONG_LONG
template <class Policy>
inline boost::long_long_type llround(const concepts::std_real_concept& v, const Policy& pol)
inline long long llround(const concepts::std_real_concept& v, const Policy& pol)
{
return boost::math::llround(v.value(), pol);
}
inline boost::long_long_type llround(const concepts::std_real_concept& v)
inline long long llround(const concepts::std_real_concept& v)
{
return boost::math::llround(v.value(), policies::policy<>());
}
#endif
template <class Policy>
inline int itrunc(const concepts::std_real_concept& v, const Policy& pol)
{
@@ -311,20 +303,16 @@ inline long ltrunc(const concepts::std_real_concept& v)
return boost::math::ltrunc(v.value(), policies::policy<>());
}
#ifdef BOOST_HAS_LONG_LONG
template <class Policy>
inline boost::long_long_type lltrunc(const concepts::std_real_concept& v, const Policy& pol)
inline long long lltrunc(const concepts::std_real_concept& v, const Policy& pol)
{
return boost::math::lltrunc(v.value(), pol);
}
inline boost::long_long_type lltrunc(const concepts::std_real_concept& v)
inline long long lltrunc(const concepts::std_real_concept& v)
{
return boost::math::lltrunc(v.value(), policies::policy<>());
}
#endif
// Streaming:
template <class charT, class traits>
inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const std_real_concept& a)
@@ -352,7 +340,6 @@ inline std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, t
} // namespace concepts
}}
#include <boost/math/tools/precision.hpp>
#include <boost/math/tools/big_constant.hpp>
namespace boost{ namespace math{
@@ -360,7 +347,7 @@ namespace tools
{
template <>
inline concepts::std_real_concept make_big_value<concepts::std_real_concept>(boost::math::tools::largest_float val, const char*, mpl::false_ const&, mpl::false_ const&)
inline concepts::std_real_concept make_big_value<concepts::std_real_concept>(boost::math::tools::largest_float val, const char*, std::false_type const&, std::false_type const&)
{
return val; // Can't use lexical_cast here, sometimes it fails....
}
@@ -396,7 +383,7 @@ inline concepts::std_real_concept epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC
}
template <>
inline BOOST_MATH_CONSTEXPR int digits<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept)) BOOST_NOEXCEPT
inline constexpr int digits<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept)) noexcept
{ // Assume number of significand bits is same as std_real_concept_base_type,
// unless std::numeric_limits<T>::is_specialized to provide digits.
return digits<concepts::std_real_concept_base_type>();
@@ -411,7 +398,7 @@ inline double real_cast<double, concepts::std_real_concept>(concepts::std_real_c
} // namespace tools
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
#if defined(_MSC_VER) && (_MSC_VER <= 1310)
using concepts::itrunc;
using concepts::ltrunc;
using concepts::lltrunc;