mirror of
https://github.com/boostorg/math.git
synced 2026-02-26 04:42:22 +00:00
Merge branch 'predef' into config
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
// can find the definitions referred to herein.
|
||||
//
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <cmath>
|
||||
#include <boost/math/tools/assert.hpp>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
|
||||
@@ -44,10 +44,6 @@
|
||||
#include <boost/math/tools/roots.hpp> // for root finding.
|
||||
#include <boost/math/distributions/detail/inv_discrete_quantile.hpp>
|
||||
|
||||
#include <boost/type_traits/is_floating_point.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#include <limits> // using std::numeric_limits;
|
||||
#include <utility>
|
||||
|
||||
|
||||
@@ -52,10 +52,6 @@
|
||||
#include <boost/math/tools/roots.hpp> // for root finding.
|
||||
#include <boost/math/distributions/detail/inv_discrete_quantile.hpp>
|
||||
|
||||
#include <boost/type_traits/is_floating_point.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#include <limits> // using std::numeric_limits;
|
||||
#include <utility>
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
barycentric_rational(std::vector<Real>&& x, std::vector<Real>&& y, size_t approximation_order = 3);
|
||||
|
||||
template <class InputIterator1, class InputIterator2>
|
||||
barycentric_rational(InputIterator1 start_x, InputIterator1 end_x, InputIterator2 start_y, size_t approximation_order = 3, typename boost::disable_if_c<boost::is_integral<InputIterator2>::value>::type* = 0);
|
||||
barycentric_rational(InputIterator1 start_x, InputIterator1 end_x, InputIterator2 start_y, size_t approximation_order = 3, typename std::enable_if<!std::is_integral<InputIterator2>::value>::type* = 0);
|
||||
|
||||
Real operator()(Real x) const;
|
||||
|
||||
@@ -77,7 +77,7 @@ barycentric_rational<Real>::barycentric_rational(std::vector<Real>&& x, std::vec
|
||||
|
||||
template <class Real>
|
||||
template <class InputIterator1, class InputIterator2>
|
||||
barycentric_rational<Real>::barycentric_rational(InputIterator1 start_x, InputIterator1 end_x, InputIterator2 start_y, size_t approximation_order, typename boost::disable_if_c<boost::is_integral<InputIterator2>::value>::type*)
|
||||
barycentric_rational<Real>::barycentric_rational(InputIterator1 start_x, InputIterator1 end_x, InputIterator2 start_y, size_t approximation_order, typename std::enable_if<!std::is_integral<InputIterator2>::value>::type*)
|
||||
: m_imp(std::make_shared<detail::barycentric_rational_imp<Real>>(start_x, end_x, start_y, approximation_order))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
#ifndef BOOST_MATH_QUADRATURE_DETAIL_TANH_SINH_CONSTANTS_HPP
|
||||
#define BOOST_MATH_QUADRATURE_DETAIL_TANH_SINH_CONSTANTS_HPP
|
||||
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
#include <type_traits>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
#include <boost/config.hpp> // for BOOST_NO_STD_LOCALE
|
||||
#include <boost/math_fwd.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
# include <locale> // for the "<<" operator
|
||||
#endif /* BOOST_NO_STD_LOCALE */
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <boost/math/special_functions/detail/bessel_jy_series.hpp>
|
||||
#include <boost/math/constants/constants.hpp>
|
||||
#include <boost/math/policies/error_handling.hpp>
|
||||
#include <boost/type_traits/is_floating_point.hpp>
|
||||
#include <complex>
|
||||
|
||||
// Bessel functions of the first and second kind of fractional order
|
||||
|
||||
@@ -21,13 +21,32 @@ With these techniques, the code could be simplified.
|
||||
#endif
|
||||
|
||||
#include <cstring>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
#include <boost/math/tools/assert.hpp>
|
||||
|
||||
// Determine endinaness
|
||||
#ifndef BOOST_MATH_STANDALONE
|
||||
|
||||
#include <boost/math/tools/assert.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/predef/other/endian.h>
|
||||
#include <boost/math/tools/assert.hpp>
|
||||
#include <boost/type_traits/is_floating_point.hpp>
|
||||
#define BOOST_MATH_ENDIAN_BIG_BYTE BOOST_ENDIAN_BIG_BYTE
|
||||
#define BOOST_MATH_ENDIAN_LITTLE_BYTE BOOST_ENDIAN_LITTLE_BYTE
|
||||
|
||||
#else // Using standalone mode
|
||||
#if (__cplusplus > 202000L || _MSVC_LANG > 202000L) && __has_include(<bit>)
|
||||
|
||||
#include <bit>
|
||||
#define BOOST_MATH_ENDIAN_BIG_BYTE (std::endian::native == std::endian::big)
|
||||
#define BOOST_MATH_ENDIAN_LITTLE_BYTE (std::endian::native == std::endian::little)
|
||||
|
||||
#else // Does not have compliant C++20
|
||||
|
||||
#define BOOST_MATH_ENDIAN_BIG_BYTE (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
|
||||
#define BOOST_MATH_ENDIAN_LITTLE_BYTE (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||
|
||||
#endif // Standalone mode
|
||||
#endif // Endian
|
||||
|
||||
#ifdef BOOST_NO_STDC_NAMESPACE
|
||||
namespace std{ using ::memcpy; }
|
||||
@@ -179,10 +198,10 @@ template<> struct fp_traits_non_native<float, single_precision>
|
||||
{
|
||||
typedef ieee_copy_all_bits_tag method;
|
||||
|
||||
BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7f800000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00000000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, significand = 0x007fffff);
|
||||
static constexpr uint32_t sign = 0x80000000u;
|
||||
static constexpr uint32_t exponent = 0x7f800000;
|
||||
static constexpr uint32_t flag = 0x00000000;
|
||||
static constexpr uint32_t significand = 0x007fffff;
|
||||
|
||||
typedef uint32_t bits;
|
||||
static void get_bits(float x, uint32_t& a) { std::memcpy(&a, &x, 4); }
|
||||
@@ -198,10 +217,10 @@ template<> struct fp_traits_non_native<double, double_precision>
|
||||
{
|
||||
typedef ieee_copy_leading_bits_tag method;
|
||||
|
||||
BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7ff00000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, flag = 0);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff);
|
||||
static constexpr uint32_t sign = 0x80000000u;
|
||||
static constexpr uint32_t exponent = 0x7ff00000;
|
||||
static constexpr uint32_t flag = 0;
|
||||
static constexpr uint32_t significand = 0x000fffff;
|
||||
|
||||
typedef uint32_t bits;
|
||||
|
||||
@@ -217,10 +236,10 @@ template<> struct fp_traits_non_native<double, double_precision>
|
||||
|
||||
private:
|
||||
|
||||
#if BOOST_ENDIAN_BIG_BYTE
|
||||
BOOST_STATIC_CONSTANT(int, offset_ = 0);
|
||||
#elif BOOST_ENDIAN_LITTLE_BYTE
|
||||
BOOST_STATIC_CONSTANT(int, offset_ = 4);
|
||||
#if BOOST_MATH_ENDIAN_BIG_BYTE
|
||||
static constexpr int offset_ = 0;
|
||||
#elif BOOST_MATH_ENDIAN_LITTLE_BYTE
|
||||
static constexpr int offset_ = 4;
|
||||
#else
|
||||
static_assert(false, "Endian type could not be identified");
|
||||
#endif
|
||||
@@ -234,10 +253,10 @@ template<> struct fp_traits_non_native<double, double_precision>
|
||||
{
|
||||
typedef ieee_copy_all_bits_tag method;
|
||||
|
||||
static const uint64_t sign = ((uint64_t)0x80000000u) << 32;
|
||||
static const uint64_t exponent = ((uint64_t)0x7ff00000) << 32;
|
||||
static const uint64_t flag = 0;
|
||||
static const uint64_t significand
|
||||
static constexpr uint64_t sign = ((uint64_t)0x80000000u) << 32;
|
||||
static constexpr uint64_t exponent = ((uint64_t)0x7ff00000) << 32;
|
||||
static constexpr uint64_t flag = 0;
|
||||
static constexpr uint64_t significand
|
||||
= (((uint64_t)0x000fffff) << 32) + ((uint64_t)0xffffffffu);
|
||||
|
||||
typedef uint64_t bits;
|
||||
@@ -258,10 +277,10 @@ template<> struct fp_traits_non_native<long double, double_precision>
|
||||
{
|
||||
typedef ieee_copy_leading_bits_tag method;
|
||||
|
||||
BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7ff00000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, flag = 0);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff);
|
||||
static constexpr uint32_t sign = 0x80000000u;
|
||||
static constexpr uint32_t exponent = 0x7ff00000;
|
||||
static constexpr uint32_t flag = 0;
|
||||
static constexpr uint32_t significand = 0x000fffff;
|
||||
|
||||
typedef uint32_t bits;
|
||||
|
||||
@@ -277,10 +296,10 @@ template<> struct fp_traits_non_native<long double, double_precision>
|
||||
|
||||
private:
|
||||
|
||||
#if BOOST_ENDIAN_BIG_BYTE
|
||||
BOOST_STATIC_CONSTANT(int, offset_ = 0);
|
||||
#elif BOOST_ENDIAN_LITTLE_BYTE
|
||||
BOOST_STATIC_CONSTANT(int, offset_ = 4);
|
||||
#if BOOST_MATH_ENDIAN_BIG_BYTE
|
||||
static constexpr int offset_ = 0;
|
||||
#elif BOOST_MATH_ENDIAN_LITTLE_BYTE
|
||||
static constexpr int offset_ = 4;
|
||||
#else
|
||||
static_assert(false, "Endian type could not be identified");
|
||||
#endif
|
||||
@@ -321,10 +340,10 @@ struct fp_traits_non_native<long double, extended_double_precision>
|
||||
{
|
||||
typedef ieee_copy_leading_bits_tag method;
|
||||
|
||||
BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7fff0000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00008000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, significand = 0x00007fff);
|
||||
static constexpr uint32_t sign = 0x80000000u;
|
||||
static constexpr uint32_t exponent = 0x7fff0000;
|
||||
static constexpr uint32_t flag = 0x00008000;
|
||||
static constexpr uint32_t significand = 0x00007fff;
|
||||
|
||||
typedef uint32_t bits;
|
||||
|
||||
@@ -372,10 +391,10 @@ struct fp_traits_non_native<long double, extended_double_precision>
|
||||
{
|
||||
typedef ieee_copy_leading_bits_tag method;
|
||||
|
||||
BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7ff00000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00000000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff);
|
||||
static constexpr uint32_t sign = 0x80000000u;
|
||||
static constexpr uint32_t exponent = 0x7ff00000;
|
||||
static constexpr uint32_t flag = 0x00000000;
|
||||
static constexpr uint32_t significand = 0x000fffff;
|
||||
|
||||
typedef uint32_t bits;
|
||||
|
||||
@@ -391,10 +410,10 @@ struct fp_traits_non_native<long double, extended_double_precision>
|
||||
|
||||
private:
|
||||
|
||||
#if BOOST_ENDIAN_BIG_BYTE
|
||||
BOOST_STATIC_CONSTANT(int, offset_ = 0);
|
||||
#elif BOOST_ENDIAN_LITTLE_BYTE
|
||||
BOOST_STATIC_CONSTANT(int, offset_ = 12);
|
||||
#if BOOST_MATH_ENDIAN_BIG_BYTE
|
||||
static constexpr int offset_ = 0;
|
||||
#elif BOOST_MATH_ENDIAN_LITTLE_BYTE
|
||||
static constexpr int offset_ = 12;
|
||||
#else
|
||||
static_assert(false, "Endian type could not be identified");
|
||||
#endif
|
||||
@@ -417,10 +436,10 @@ struct fp_traits_non_native<long double, extended_double_precision>
|
||||
{
|
||||
typedef ieee_copy_leading_bits_tag method;
|
||||
|
||||
BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7fff0000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00008000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, significand = 0x00007fff);
|
||||
static constexpr uint32_t sign = 0x80000000u;
|
||||
static constexpr uint32_t exponent = 0x7fff0000;
|
||||
static constexpr uint32_t flag = 0x00008000;
|
||||
static constexpr uint32_t significand = 0x00007fff;
|
||||
|
||||
// copy 1st, 2nd, 5th and 6th byte. 3rd and 4th byte are padding.
|
||||
|
||||
@@ -453,10 +472,10 @@ struct fp_traits_non_native<long double, extended_double_precision>
|
||||
{
|
||||
typedef ieee_copy_leading_bits_tag method;
|
||||
|
||||
BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7fff0000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00000000);
|
||||
BOOST_STATIC_CONSTANT(uint32_t, significand = 0x0000ffff);
|
||||
static constexpr uint32_t sign = 0x80000000u;
|
||||
static constexpr uint32_t exponent = 0x7fff0000;
|
||||
static constexpr uint32_t flag = 0x00000000;
|
||||
static constexpr uint32_t significand = 0x0000ffff;
|
||||
|
||||
typedef uint32_t bits;
|
||||
|
||||
@@ -472,10 +491,10 @@ struct fp_traits_non_native<long double, extended_double_precision>
|
||||
|
||||
private:
|
||||
|
||||
#if BOOST_ENDIAN_BIG_BYTE
|
||||
BOOST_STATIC_CONSTANT(int, offset_ = 0);
|
||||
#elif BOOST_ENDIAN_LITTLE_BYTE
|
||||
BOOST_STATIC_CONSTANT(int, offset_ = 12);
|
||||
#if BOOST_MATH_ENDIAN_BIG_BYTE
|
||||
static constexpr int offset_ = 0;
|
||||
#elif BOOST_MATH_ENDIAN_LITTLE_BYTE
|
||||
static constexpr int offset_ = 12;
|
||||
#else
|
||||
static_assert(false, "Endian type could not be identified");
|
||||
#endif
|
||||
@@ -526,7 +545,7 @@ template<> struct size_to_precision<16, true>
|
||||
template <class T>
|
||||
struct select_native
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME size_to_precision<sizeof(T), ::boost::is_floating_point<T>::value>::type precision;
|
||||
typedef BOOST_DEDUCED_TYPENAME size_to_precision<sizeof(T), ::std::is_floating_point<T>::value>::type precision;
|
||||
typedef fp_traits_non_native<T, precision> type;
|
||||
};
|
||||
template<>
|
||||
@@ -564,7 +583,7 @@ struct select_native<long double>
|
||||
|
||||
template<class T> struct fp_traits
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME size_to_precision<sizeof(T), ::boost::is_floating_point<T>::value>::type precision;
|
||||
typedef BOOST_DEDUCED_TYPENAME size_to_precision<sizeof(T), ::std::is_floating_point<T>::value>::type precision;
|
||||
#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY)
|
||||
typedef typename select_native<T>::type type;
|
||||
#else
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <type_traits>
|
||||
#include <boost/math/special_functions/round.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
namespace boost { namespace math { namespace detail{
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
#include <boost/math/special_functions/detail/lgamma_small.hpp>
|
||||
#include <boost/math/special_functions/bernoulli.hpp>
|
||||
#include <boost/math/special_functions/polygamma.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/math/tools/assert.hpp>
|
||||
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
#include <type_traits>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
|
||||
@@ -58,7 +58,6 @@ BOOST_MATH_INSTRUMENT_LAMBERT_W_SMALL_Z_SERIES_ITERATIONS // Show evaluation of
|
||||
#include <boost/math/tools/series.hpp> // series functor.
|
||||
//#include <boost/math/tools/polynomial.hpp> // polynomial.
|
||||
#include <boost/math/tools/rational.hpp> // evaluate_polynomial.
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/math/tools/precision.hpp> // boost::math::tools::max_value().
|
||||
#include <boost/math/tools/big_constant.hpp>
|
||||
#include <boost/math/tools/cxx03_warn.hpp>
|
||||
@@ -1744,7 +1743,7 @@ T lambert_wm1_imp(const T z, const Policy& pol)
|
||||
// Integral types should be promoted to double by user Lambert w functions.
|
||||
// If integral type provided to user function lambert_w0 or lambert_wm1,
|
||||
// then should already have been promoted to double.
|
||||
static_assert(!boost::is_integral<T>::value,
|
||||
static_assert(!std::is_integral<T>::value,
|
||||
"Must be floating-point or fixed type (not integer type), for example: lambert_wm1(1.), not lambert_wm1(1)!");
|
||||
|
||||
BOOST_MATH_STD_USING // Aid argument dependent lookup (ADL) of abs.
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
|
||||
#include <boost/math/special_functions/math_fwd.hpp>
|
||||
#include <boost/math/policies/error_handling.hpp>
|
||||
#include <boost/math/special_functions/fpclassify.hpp>
|
||||
#include <boost/math/special_functions/sign.hpp>
|
||||
#include <boost/math/special_functions/trunc.hpp>
|
||||
#include <boost/math/tools/traits.hpp>
|
||||
#include <type_traits>
|
||||
#include <cfloat>
|
||||
|
||||
#include <float.h>
|
||||
|
||||
#if !defined(_CRAYC) && !defined(__CUDACC__) && (!defined(__GNUC__) || (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 3)))
|
||||
#if (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || defined(__SSE2__)
|
||||
@@ -684,18 +684,18 @@ inline typename tools::promote_args<T, U>::type float_distance(const T& a, const
|
||||
// We allow ONE of a and b to be an integer type, otherwise both must be the SAME type.
|
||||
//
|
||||
static_assert(
|
||||
(boost::is_same<T, U>::value
|
||||
|| (boost::is_integral<T>::value && !boost::is_integral<U>::value)
|
||||
|| (!boost::is_integral<T>::value && boost::is_integral<U>::value)
|
||||
(std::is_same<T, U>::value
|
||||
|| (std::is_integral<T>::value && !std::is_integral<U>::value)
|
||||
|| (!std::is_integral<T>::value && std::is_integral<U>::value)
|
||||
|| (std::numeric_limits<T>::is_specialized && std::numeric_limits<U>::is_specialized
|
||||
&& (std::numeric_limits<T>::digits == std::numeric_limits<U>::digits)
|
||||
&& (std::numeric_limits<T>::radix == std::numeric_limits<U>::radix)
|
||||
&& !std::numeric_limits<T>::is_integer && !std::numeric_limits<U>::is_integer)),
|
||||
"Float distance between two different floating point types is undefined.");
|
||||
|
||||
BOOST_IF_CONSTEXPR (!boost::is_same<T, U>::value)
|
||||
BOOST_IF_CONSTEXPR (!std::is_same<T, U>::value)
|
||||
{
|
||||
BOOST_IF_CONSTEXPR(boost::is_integral<T>::value)
|
||||
BOOST_IF_CONSTEXPR(std::is_integral<T>::value)
|
||||
{
|
||||
return float_distance(static_cast<U>(a), b, pol);
|
||||
}
|
||||
|
||||
@@ -10,12 +10,11 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <type_traits>
|
||||
#include <boost/math/special_functions/math_fwd.hpp>
|
||||
#include <boost/math/tools/config.hpp>
|
||||
#include <boost/math/policies/error_handling.hpp>
|
||||
#include <boost/math/special_functions/fpclassify.hpp>
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
namespace boost{ namespace math{ namespace detail{
|
||||
|
||||
@@ -123,7 +122,7 @@ inline typename std::enable_if<std::is_constructible<int, T>::value, int>::type
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
inline typename boost::disable_if_c<std::is_constructible<int, T>::value, int>::type
|
||||
inline typename std::enable_if<!std::is_constructible<int, T>::value, int>::type
|
||||
iconvert(const T& v, const Policy& pol)
|
||||
{
|
||||
using boost::math::itrunc;
|
||||
@@ -138,7 +137,7 @@ inline typename std::enable_if<std::is_constructible<long, T>::value, long>::typ
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
inline typename boost::disable_if_c<std::is_constructible<long, T>::value, long>::type
|
||||
inline typename std::enable_if<!std::is_constructible<long, T>::value, long>::type
|
||||
lconvert(const T& v, const Policy& pol)
|
||||
{
|
||||
using boost::math::ltrunc;
|
||||
@@ -155,7 +154,7 @@ inline typename std::enable_if<std::is_constructible<boost::long_long_type, T>::
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
inline typename boost::disable_if_c<std::is_constructible<boost::long_long_type, T>::value, boost::long_long_type>::type
|
||||
inline typename std::enable_if<!std::is_constructible<boost::long_long_type, T>::value, boost::long_long_type>::type
|
||||
llconvertert(const T& v, const Policy& pol)
|
||||
{
|
||||
using boost::math::lltrunc;
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
#ifndef BOOST_MATH_NO_LEXICAL_CAST
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#endif
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/is_floating_point.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
#include <limits>
|
||||
|
||||
namespace boost{ namespace math{
|
||||
|
||||
@@ -73,7 +73,7 @@ inline BOOST_MATH_CONSTEXPR T make_big_value(largest_float, const char* s, std::
|
||||
BOOST_STRINGIZE(x), \
|
||||
std::integral_constant<bool, (std::is_convertible<boost::math::tools::largest_float, T>::value) && \
|
||||
((D <= boost::math::tools::numeric_traits<boost::math::tools::largest_float>::digits) \
|
||||
|| boost::is_floating_point<T>::value \
|
||||
|| std::is_floating_point<T>::value \
|
||||
|| (boost::math::tools::numeric_traits<T>::is_specialized && \
|
||||
(boost::math::tools::numeric_traits<T>::digits10 <= boost::math::tools::numeric_traits<boost::math::tools::largest_float>::digits10))) >(), \
|
||||
std::is_constructible<T, const char*>())
|
||||
@@ -82,7 +82,7 @@ inline BOOST_MATH_CONSTEXPR T make_big_value(largest_float, const char* s, std::
|
||||
//
|
||||
#define BOOST_MATH_HUGE_CONSTANT(T, D, x)\
|
||||
boost::math::tools::make_big_value<T>(0.0L, BOOST_STRINGIZE(x), \
|
||||
std::integral_constant<bool, boost::is_floating_point<T>::value || (boost::math::tools::numeric_traits<T>::is_specialized && boost::math::tools::numeric_traits<T>::max_exponent <= boost::math::tools::numeric_traits<boost::math::tools::largest_float>::max_exponent && boost::math::tools::numeric_traits<T>::digits <= boost::math::tools::numeric_traits<boost::math::tools::largest_float>::digits)>(), \
|
||||
std::integral_constant<bool, std::is_floating_point<T>::value || (boost::math::tools::numeric_traits<T>::is_specialized && boost::math::tools::numeric_traits<T>::max_exponent <= boost::math::tools::numeric_traits<boost::math::tools::largest_float>::max_exponent && boost::math::tools::numeric_traits<T>::digits <= boost::math::tools::numeric_traits<boost::math::tools::largest_float>::digits)>(), \
|
||||
std::is_constructible<T, const char*>())
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
@@ -10,17 +10,25 @@
|
||||
#ifndef BOOST_MATH_TOOLS_COMPLEX_HPP
|
||||
#define BOOST_MATH_TOOLS_COMPLEX_HPP
|
||||
|
||||
#include <boost/type_traits/is_complex.hpp>
|
||||
#include <utility>
|
||||
#include <boost/math/tools/is_detected.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace math {
|
||||
namespace tools {
|
||||
|
||||
//
|
||||
// Specialize this trait for user-defined complex types (ie Boost.Multiprecision):
|
||||
//
|
||||
template <class T>
|
||||
struct is_complex_type : public boost::is_complex<T> {};
|
||||
template <typename T, typename = void>
|
||||
struct is_complex_type
|
||||
{
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_complex_type<T, void_t<decltype(std::declval<T>().real()),
|
||||
decltype(std::declval<T>().imag())>>
|
||||
{
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
//
|
||||
// Use this trait to typecast integer literals to something
|
||||
// that will interoperate with T:
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/predef/architecture/x86.h>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <algorithm> // for min and max
|
||||
#include <cmath>
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
#include <type_traits>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{
|
||||
@@ -19,7 +18,7 @@ namespace boost{ namespace math{ namespace tools{
|
||||
template <class T>
|
||||
struct convert_from_string_result
|
||||
{
|
||||
typedef typename boost::conditional<std::is_constructible<T, const char*>::value, const char*, T>::type type;
|
||||
typedef typename std::conditional<std::is_constructible<T, const char*>::value, const char*, T>::type type;
|
||||
};
|
||||
|
||||
template <class Real>
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/math/tools/cxx03_warn.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_SFINAE_EXPR)
|
||||
#if !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES)
|
||||
|
||||
#define BOOST_MATH_HAS_IS_CONST_ITERABLE
|
||||
|
||||
#include <boost/type_traits/is_detected.hpp>
|
||||
#include <boost/math/tools/is_detected.hpp>
|
||||
#include <utility>
|
||||
|
||||
namespace boost {
|
||||
@@ -31,9 +31,9 @@ namespace boost {
|
||||
template <class T>
|
||||
struct is_const_iterable
|
||||
: public std::integral_constant<bool,
|
||||
boost::is_detected<begin_t, T>::value
|
||||
&& boost::is_detected<end_t, T>::value
|
||||
&& boost::is_detected<const_iterator_t, T>::value
|
||||
is_detected<begin_t, T>::value
|
||||
&& is_detected<end_t, T>::value
|
||||
&& is_detected<const_iterator_t, T>::value
|
||||
> {};
|
||||
|
||||
} } } }
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <ostream>
|
||||
#include <algorithm>
|
||||
#include <initializer_list>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{
|
||||
|
||||
@@ -122,7 +123,7 @@ namespace detail {
|
||||
* subtlety of distinction.
|
||||
*/
|
||||
template <typename T, typename N>
|
||||
BOOST_DEDUCED_TYPENAME disable_if_c<std::numeric_limits<T>::is_integer, void >::type
|
||||
BOOST_DEDUCED_TYPENAME std::enable_if<!std::numeric_limits<T>::is_integer, void >::type
|
||||
division_impl(polynomial<T> &q, polynomial<T> &u, const polynomial<T>& v, N n, N k)
|
||||
{
|
||||
q[k] = u[n + k] / v[n];
|
||||
@@ -165,7 +166,7 @@ T integer_power(T t, N n)
|
||||
* don't currently have that subtlety of distinction.
|
||||
*/
|
||||
template <typename T, typename N>
|
||||
BOOST_DEDUCED_TYPENAME enable_if_c<std::numeric_limits<T>::is_integer, void >::type
|
||||
BOOST_DEDUCED_TYPENAME std::enable_if<std::numeric_limits<T>::is_integer, void >::type
|
||||
division_impl(polynomial<T> &q, polynomial<T> &u, const polynomial<T>& v, N n, N k)
|
||||
{
|
||||
q[k] = u[n + k] * integer_power(v[n], k);
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <type_traits>
|
||||
#include <boost/math/tools/polynomial.hpp>
|
||||
#include <boost/integer/common_factor_rt.hpp>
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
|
||||
|
||||
namespace boost{
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace detail
|
||||
* @return Greatest common divisor of polynomials u and v.
|
||||
*/
|
||||
template <class T>
|
||||
typename enable_if_c< std::numeric_limits<T>::is_integer, polynomial<T> >::type
|
||||
typename std::enable_if< std::numeric_limits<T>::is_integer, polynomial<T> >::type
|
||||
subresultant_gcd(polynomial<T> u, polynomial<T> v)
|
||||
{
|
||||
using std::swap;
|
||||
@@ -167,14 +167,14 @@ subresultant_gcd(polynomial<T> u, polynomial<T> v)
|
||||
* @tparam T A multi-precision integral type.
|
||||
*/
|
||||
template <typename T>
|
||||
typename enable_if_c<std::numeric_limits<T>::is_integer && !std::numeric_limits<T>::is_bounded, polynomial<T> >::type
|
||||
typename std::enable_if<std::numeric_limits<T>::is_integer && !std::numeric_limits<T>::is_bounded, polynomial<T> >::type
|
||||
gcd(polynomial<T> const &u, polynomial<T> const &v)
|
||||
{
|
||||
return subresultant_gcd(u, v);
|
||||
}
|
||||
// GCD over bounded integers is not currently allowed:
|
||||
template <typename T>
|
||||
typename enable_if_c<std::numeric_limits<T>::is_integer && std::numeric_limits<T>::is_bounded, polynomial<T> >::type
|
||||
typename std::enable_if<std::numeric_limits<T>::is_integer && std::numeric_limits<T>::is_bounded, polynomial<T> >::type
|
||||
gcd(polynomial<T> const &u, polynomial<T> const &v)
|
||||
{
|
||||
static_assert(sizeof(v) == 0, "GCD on polynomials of bounded integers is disallowed due to the excessive growth in the size of intermediate terms.");
|
||||
@@ -182,7 +182,7 @@ gcd(polynomial<T> const &u, polynomial<T> const &v)
|
||||
}
|
||||
// GCD over polynomials of floats can go via the Euclid algorithm:
|
||||
template <typename T>
|
||||
typename enable_if_c<!std::numeric_limits<T>::is_integer && (std::numeric_limits<T>::min_exponent != std::numeric_limits<T>::max_exponent) && !std::numeric_limits<T>::is_exact, polynomial<T> >::type
|
||||
typename std::enable_if<!std::numeric_limits<T>::is_integer && (std::numeric_limits<T>::min_exponent != std::numeric_limits<T>::max_exponent) && !std::numeric_limits<T>::is_exact, polynomial<T> >::type
|
||||
gcd(polynomial<T> const &u, polynomial<T> const &v)
|
||||
{
|
||||
return boost::integer::gcd_detail::Euclid_gcd(u, v);
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
|
||||
#include <boost/cstdfloat.hpp> // For float_64_t, float128_t. Must be first include!
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
|
||||
#ifdef BOOST_MATH_INSTRUMENT_CREATE_TEST_VALUE
|
||||
// global int create_type(0); must be defined before including this file.
|
||||
|
||||
Reference in New Issue
Block a user