2
0
mirror of https://github.com/boostorg/math.git synced 2026-02-23 03:42:20 +00:00

Remove <boost/config/no_tr1/cmath.hpp>

This commit is contained in:
Matt Borland
2021-03-21 14:46:05 +03:00
parent dfffef78a7
commit fc9891cccd
18 changed files with 48 additions and 71 deletions

View File

@@ -7,7 +7,6 @@
#define BOOST_MATH_NTL_RR_HPP
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/math/tools/real_cast.hpp>
#include <boost/math/tools/precision.hpp>
#include <boost/math/constants/constants.hpp>
@@ -15,10 +14,11 @@
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/bindings/detail/big_digamma.hpp>
#include <boost/math/bindings/detail/big_lanczos.hpp>
#include <stdexcept>
#include <ostream>
#include <istream>
#include <boost/config/no_tr1/cmath.hpp>
#include <cmath>
#include <limits>
#include <NTL/RR.h>
namespace boost{ namespace math{

View File

@@ -10,21 +10,16 @@
// inverse trig complex functions, it also contains all the includes
// that we need to implement all these functions.
//
#include <boost/config.hpp>
#include <cmath>
#include <complex>
#include <limits>
#include <boost/detail/workaround.hpp>
#include <boost/config/no_tr1/complex.hpp>
#include <boost/limits.hpp>
#include <math.h> // isnan where available
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/math/special_functions/sign.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/special_functions/sign.hpp>
#include <boost/math/constants/constants.hpp>
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std{ using ::sqrt; }
#endif
namespace boost{ namespace math{ namespace detail{
template <class T>

View File

@@ -17,14 +17,12 @@
// 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

View File

@@ -17,9 +17,8 @@
#include <boost/math/constants/constants.hpp>
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <boost/config/no_tr1/cmath.hpp>
#include <utility>
#include <cmath>
namespace boost{ namespace math
{

View File

@@ -12,7 +12,6 @@
#include <boost/math/special_functions/expm1.hpp>
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <boost/config/no_tr1/cmath.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
@@ -21,6 +20,7 @@
#endif
#include <utility>
#include <cmath>
namespace boost{ namespace math{

View File

@@ -12,7 +12,6 @@
#include <boost/math/special_functions/expm1.hpp>
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <boost/config/no_tr1/cmath.hpp>
//
// This is the maximum extreme value distribution, see
@@ -22,6 +21,7 @@
// distribution or a Gumbel distribution.
#include <utility>
#include <cmath>
#ifdef BOOST_MSVC
# pragma warning(push)

View File

@@ -12,7 +12,6 @@
#include <boost/math/special_functions/expm1.hpp>
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <boost/config/no_tr1/cmath.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
@@ -20,6 +19,7 @@
#endif
#include <utility>
#include <cmath>
namespace boost{ namespace math{

View File

@@ -15,8 +15,7 @@
#pragma once
#endif
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/config.hpp>
#include <cmath>
#include <boost/math/tools/precision.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/special_functions/math_fwd.hpp>

View File

@@ -16,8 +16,7 @@
#endif
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/config.hpp>
#include <cmath>
#include <boost/math/tools/precision.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/special_functions/sqrt1pm1.hpp>

View File

@@ -15,9 +15,7 @@
#pragma once
#endif
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/config.hpp>
#include <cmath>
#include <boost/math/tools/precision.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/special_functions/math_fwd.hpp>

View File

@@ -10,8 +10,8 @@
#pragma once
#endif
#include <cmath>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/math/tools/config.hpp>
#include <boost/math/special_functions/trunc.hpp>
#include <boost/math/tools/promotion.hpp>

View File

@@ -14,12 +14,8 @@
#include <boost/math/tools/precision.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/config/no_tr1/cmath.hpp>
#include <algorithm> // for swap
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std{ using ::sqrt; using ::fabs; }
#endif
#include <cmath>
namespace boost{ namespace math{ namespace detail{

View File

@@ -10,7 +10,7 @@
#pragma once
#endif
#include <boost/config/no_tr1/cmath.hpp>
#include <cmath>
#include <boost/math/tools/config.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/special_functions/trunc.hpp>

View File

@@ -19,14 +19,10 @@
#include <boost/math/tools/precision.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/limits.hpp>
#include <limits>
#include <string>
#include <stdexcept>
#include <boost/config.hpp>
#include <cmath>
// These are the the "Sinus Cardinal" functions.
@@ -70,7 +66,6 @@ namespace boost
return detail::sinc_pi_imp(static_cast<result_type>(x));
}
#ifndef BOOST_NO_TEMPLATE_TEMPLATES
template<typename T, template<typename> class U>
inline U<T> sinc_pi(const U<T> x)
{
@@ -117,7 +112,6 @@ namespace boost
{
return sinc_pi(x);
}
#endif /* BOOST_NO_TEMPLATE_TEMPLATES */
}
}

View File

@@ -18,14 +18,13 @@
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/precision.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/limits.hpp>
#include <limits>
#include <string>
#include <stdexcept>
#include <cmath>
#include <boost/config.hpp>
// These are the the "Hyperbolic Sinus Cardinal" functions.
namespace boost

View File

@@ -11,16 +11,16 @@
#pragma once
#endif
#include <cstdint>
#include <cmath>
#include <utility>
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/math/tools/precision.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/cstdint.hpp>
namespace boost{ namespace math{ namespace tools{
template <class F, class T>
std::pair<T, T> brent_find_minima(F f, T min, T max, int bits, boost::uintmax_t& max_iter)
std::pair<T, T> brent_find_minima(F f, T min, T max, int bits, std::uintmax_t& max_iter)
BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval<F>()(std::declval<T>())))
{
BOOST_MATH_STD_USING
@@ -141,7 +141,7 @@ template <class F, class T>
inline std::pair<T, T> brent_find_minima(F f, T min, T max, int digits)
BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && noexcept(std::declval<F>()(std::declval<T>())))
{
boost::uintmax_t m = (std::numeric_limits<boost::uintmax_t>::max)();
std::uintmax_t m = (std::numeric_limits<std::uintmax_t>::max)();
return brent_find_minima(f, min, max, digits, m);
}

View File

@@ -10,9 +10,9 @@
#pragma once
#endif
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/cstdint.hpp>
#include <boost/limits.hpp>
#include <cmath>
#include <cstdint>
#include <limits>
#include <boost/math/tools/config.hpp>
namespace boost{ namespace math{ namespace tools{
@@ -21,13 +21,13 @@ namespace boost{ namespace math{ namespace tools{
// Simple series summation come first:
//
template <class Functor, class U, class V>
inline typename Functor::result_type sum_series(Functor& func, const U& factor, boost::uintmax_t& max_terms, const V& init_value) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
inline typename Functor::result_type sum_series(Functor& func, const U& factor, std::uintmax_t& max_terms, const V& init_value) noexcept(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
{
BOOST_MATH_STD_USING
typedef typename Functor::result_type result_type;
boost::uintmax_t counter = max_terms;
std::uintmax_t counter = max_terms;
result_type result = init_value;
result_type next_term;
@@ -44,14 +44,14 @@ inline typename Functor::result_type sum_series(Functor& func, const U& factor,
}
template <class Functor, class U>
inline typename Functor::result_type sum_series(Functor& func, const U& factor, boost::uintmax_t& max_terms) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
inline typename Functor::result_type sum_series(Functor& func, const U& factor, std::uintmax_t& max_terms) noexcept(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
{
typename Functor::result_type init_value = 0;
return sum_series(func, factor, max_terms, init_value);
}
template <class Functor, class U>
inline typename Functor::result_type sum_series(Functor& func, int bits, boost::uintmax_t& max_terms, const U& init_value) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
inline typename Functor::result_type sum_series(Functor& func, int bits, std::uintmax_t& max_terms, const U& init_value) noexcept(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
{
BOOST_MATH_STD_USING
typedef typename Functor::result_type result_type;
@@ -60,17 +60,17 @@ inline typename Functor::result_type sum_series(Functor& func, int bits, boost::
}
template <class Functor>
inline typename Functor::result_type sum_series(Functor& func, int bits) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
inline typename Functor::result_type sum_series(Functor& func, int bits) noexcept(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
{
BOOST_MATH_STD_USING
typedef typename Functor::result_type result_type;
boost::uintmax_t iters = (std::numeric_limits<boost::uintmax_t>::max)();
std::uintmax_t iters = (std::numeric_limits<std::uintmax_t>::max)();
result_type init_val = 0;
return sum_series(func, bits, iters, init_val);
}
template <class Functor>
inline typename Functor::result_type sum_series(Functor& func, int bits, boost::uintmax_t& max_terms) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
inline typename Functor::result_type sum_series(Functor& func, int bits, std::uintmax_t& max_terms) noexcept(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
{
BOOST_MATH_STD_USING
typedef typename Functor::result_type result_type;
@@ -79,23 +79,23 @@ inline typename Functor::result_type sum_series(Functor& func, int bits, boost::
}
template <class Functor, class U>
inline typename Functor::result_type sum_series(Functor& func, int bits, const U& init_value) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
inline typename Functor::result_type sum_series(Functor& func, int bits, const U& init_value) noexcept(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
{
BOOST_MATH_STD_USING
boost::uintmax_t iters = (std::numeric_limits<boost::uintmax_t>::max)();
std::uintmax_t iters = (std::numeric_limits<std::uintmax_t>::max)();
return sum_series(func, bits, iters, init_value);
}
//
// Checked summation:
//
template <class Functor, class U, class V>
inline typename Functor::result_type checked_sum_series(Functor& func, const U& factor, boost::uintmax_t& max_terms, const V& init_value, V& norm) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
inline typename Functor::result_type checked_sum_series(Functor& func, const U& factor, std::uintmax_t& max_terms, const V& init_value, V& norm) noexcept(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
{
BOOST_MATH_STD_USING
typedef typename Functor::result_type result_type;
boost::uintmax_t counter = max_terms;
std::uintmax_t counter = max_terms;
result_type result = init_value;
result_type next_term;
@@ -125,7 +125,7 @@ inline typename Functor::result_type checked_sum_series(Functor& func, const U&
// in any case the result is still much better than a naive summation.
//
template <class Functor>
inline typename Functor::result_type kahan_sum_series(Functor& func, int bits) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
inline typename Functor::result_type kahan_sum_series(Functor& func, int bits) noexcept(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
{
BOOST_MATH_STD_USING
@@ -148,13 +148,13 @@ inline typename Functor::result_type kahan_sum_series(Functor& func, int bits) B
}
template <class Functor>
inline typename Functor::result_type kahan_sum_series(Functor& func, int bits, boost::uintmax_t& max_terms) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
inline typename Functor::result_type kahan_sum_series(Functor& func, int bits, std::uintmax_t& max_terms) noexcept(BOOST_MATH_IS_FLOAT(typename Functor::result_type) && noexcept(std::declval<Functor>()()))
{
BOOST_MATH_STD_USING
typedef typename Functor::result_type result_type;
boost::uintmax_t counter = max_terms;
std::uintmax_t counter = max_terms;
result_type factor = ldexp(result_type(1), bits);
result_type result = func();

View File

@@ -10,8 +10,8 @@
#pragma once
#endif
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/cstdint.hpp>
#include <cstdint>
#include <cmath>
#include <boost/math/tools/precision.hpp>
namespace boost{ namespace math{ namespace tools{
@@ -41,7 +41,7 @@ public:
T max BOOST_PREVENT_MACRO_SUBSTITUTION()const{ return m_max; }
T total()const{ return m_total; }
T mean()const{ return m_total / static_cast<T>(m_count); }
boost::uintmax_t count()const{ return m_count; }
std::uintmax_t count()const{ return m_count; }
T variance()const
{
BOOST_MATH_STD_USING
@@ -77,7 +77,7 @@ public:
}
private:
T m_min, m_max, m_total, m_squared_total;
boost::uintmax_t m_count;
std::uintmax_t m_count;
};
} // namespace tools