2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Merge branch 'develop' into bernoulli_threading_2

Fixed Conflicts:
	include/boost/math/special_functions/lanczos.hpp
This commit is contained in:
jzmaddock
2021-05-23 20:05:51 +01:00
17 changed files with 148 additions and 321 deletions

View File

@@ -82,7 +82,7 @@ The following compilers are tested with the CI system, and are known to work. St
| | Master | Develop |
|------------------|----------|-------------|
| Github Actions | [![Build Status](https://github.com/boostorg/math/workflows/CI/badge.svg?branch=master)](https://github.com/boostorg/math/actions) | [![Build Status](https://github.com/boostorg/math/workflows/CI/badge.svg?branch=develop)](https://github.com/boostorg/math/actions) |
|Drone | [![Build Status](https://drone.cpp.al/api/badges/boostorg/math/status.svg?ref=refs/heads/master)](https://drone.cpp.al/boostorg/math) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/math/status.svg)](https:/drone.cpp.al/boostorg/math) |
|Drone | [![Build Status](https://drone.cpp.al/api/badges/boostorg/math/status.svg?ref=refs/heads/master)](https://drone.cpp.al/boostorg/math) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/math/status.svg)](https://drone.cpp.al/boostorg/math) |

View File

@@ -173,7 +173,7 @@ public:
return dydx;
}
inline Real double_prime(Real x) const
inline Real double_prime(Real) const
{
return std::numeric_limits<Real>::quiet_NaN();
}

View File

@@ -455,202 +455,6 @@ struct lanczos13 : public std::integral_constant<int, 72>
static double g(){ return 13.1445650000000000545696821063756942749; }
};
//
// Lanczos Coefficients for N=22 G=22.61891
// Max experimental error (with arbitrary precision arithmetic) 2.9524e-38
// Generated with compiler: Microsoft Visual C++ version 8.0 on Win32 at Mar 23 2006
//
struct lanczos22 : public std::integral_constant<int, 120>
{
//
// Produces slightly better than 128-bit long-double precision when
// evaluated at higher precision:
//
template <class T>
static T lanczos_sum(const T& z)
{
lanczos_initializer<lanczos22, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[22] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 46198410803245094237463011094.12173081986)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 43735859291852324413622037436.321513777)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 19716607234435171720534556386.97481377748)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 5629401471315018442177955161.245623932129)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 1142024910634417138386281569.245580222392)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 175048529315951173131586747.695329230778)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 21044290245653709191654675.41581372963167)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 2033001410561031998451380.335553678782601)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 160394318862140953773928.8736211601848891)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 10444944438396359705707.48957290388740896)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 565075825801617290121.1466393747967538948)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 25475874292116227538.99448534450411942597)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 957135055846602154.6720835535232270205725)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 29874506304047462.23662392445173880821515)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 769651310384737.2749087590725764959689181)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 16193289100889.15989633624378404096011797)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 273781151680.6807433264462376754578933261)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 3630485900.32917021712188739762161583295)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 36374352.05577334277856865691538582936484)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 258945.7742115532455441786924971194951043)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 1167.501919472435718934219997431551246996)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 2.50662827463100050241576528481104525333))
};
static const BOOST_MATH_INT_TABLE_TYPE(T, std::uint64_t) denom[22] = {
BOOST_MATH_INT_VALUE_SUFFIX(0, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(2432902008176640000, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(8752948036761600000, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(13803759753640704000, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(12870931245150988800, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(8037811822645051776, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(3599979517947607200, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(1206647803780373360, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(311333643161390640, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(63030812099294896, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(10142299865511450, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(1307535010540395, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(135585182899530, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(11310276995381, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(756111184500, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(40171771630, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(1672280820, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(53327946, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(1256850, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(20615, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(210, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(1, uLL)
};
return boost::math::tools::evaluate_rational(num, denom, z);
}
template <class T>
static T lanczos_sum_expG_scaled(const T& z)
{
lanczos_initializer<lanczos22, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[22] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 6939996264376682180.277485395074954356211)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 6570067992110214451.87201438870245659384)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 2961859037444440551.986724631496417064121)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 845657339772791245.3541226499766163431651)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 171556737035449095.2475716923888737881837)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 26296059072490867.7822441885603400926007)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 3161305619652108.433798300149816829198706)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 305400596026022.4774396904484542582526472)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 24094681058862.55120507202622377623528108)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 1569055604375.919477574824168939428328839)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 84886558909.02047889339710230696942513159)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 3827024985.166751989686050643579753162298)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 143782298.9273215199098728674282885500522)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 4487794.24541641841336786238909171265944)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 115618.2025760830513505888216285273541959)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 2432.580773108508276957461757328744780439)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 41.12782532742893597168530008461874360191)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.5453771709477689805460179187388702295792)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.005464211062612080347167337964166505282809)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.388992321263586767037090706042788910953e-4)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.1753839324538447655939518484052327068859e-6)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.3765495513732730583386223384116545391759e-9))
};
static const BOOST_MATH_INT_TABLE_TYPE(T, std::uint64_t) denom[22] = {
BOOST_MATH_INT_VALUE_SUFFIX(0, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(2432902008176640000, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(8752948036761600000, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(13803759753640704000, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(12870931245150988800, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(8037811822645051776, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(3599979517947607200, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(1206647803780373360, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(311333643161390640, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(63030812099294896, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(10142299865511450, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(1307535010540395, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(135585182899530, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(11310276995381, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(756111184500, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(40171771630, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(1672280820, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(53327946, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(1256850, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(20615, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(210, uLL),
BOOST_MATH_INT_VALUE_SUFFIX(1, uLL)
};
return boost::math::tools::evaluate_rational(num, denom, z);
}
template<class T>
static T lanczos_sum_near_1(const T& dz)
{
lanczos_initializer<lanczos22, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[21] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 8.318998691953337183034781139546384476554)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -63.15415991415959158214140353299240638675)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 217.3108224383632868591462242669081540163)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -448.5134281386108366899784093610397354889)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 619.2903759363285456927248474593012711346)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -604.1630177420625418522025080080444177046)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 428.8166750424646119935047118287362193314)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -224.6988753721310913866347429589434550302)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 87.32181627555510833499451817622786940961)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -25.07866854821128965662498003029199058098)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 5.264398125689025351448861011657789005392)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -0.792518936256495243383586076579921559914)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.08317448364744713773350272460937904691566)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -0.005845345166274053157781068150827567998882)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.0002599412126352082483326238522490030412391)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -0.6748102079670763884917431338234783496303e-5)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.908824383434109002762325095643458603605e-7)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -0.5299325929309389890892469299969669579725e-9)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.994306085859549890267983602248532869362e-12)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -0.3499893692975262747371544905820891835298e-15)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.7260746353663365145454867069182884694961e-20)),
};
T result = 0;
for(unsigned k = 1; k <= sizeof(d)/sizeof(d[0]); ++k)
{
result += (-d[k-1]*dz)/(k*dz + k*k);
}
return result;
}
template<class T>
static T lanczos_sum_near_2(const T& dz)
{
lanczos_initializer<lanczos22, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[21] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 75.39272007105208086018421070699575462226)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -572.3481967049935412452681346759966390319)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 1969.426202741555335078065370698955484358)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -4064.74968778032030891520063865996757519)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 5612.452614138013929794736248384309574814)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -5475.357667500026172903620177988213902339)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 3886.243614216111328329547926490398103492)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -2036.382026072125407192448069428134470564)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 791.3727954936062108045551843636692287652)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -227.2808432388436552794021219198885223122)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 47.70974355562144229897637024320739257284)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -7.182373807798293545187073539819697141572)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.7537866989631514559601547530490976100468)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -0.05297470142240154822658739758236594717787)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.00235577330936380542539812701472320434133)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -0.6115613067659273118098229498679502138802e-4)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.8236417010170941915758315020695551724181e-6)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -0.4802628430993048190311242611330072198089e-8)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.9011113376981524418952720279739624707342e-11)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -0.3171854152689711198382455703658589996796e-14)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 0.6580207998808093935798753964580596673177e-19)),
};
T result = 0;
T z = dz + 2;
for(unsigned k = 1; k <= sizeof(d)/sizeof(d[0]); ++k)
{
result += (-d[k-1]*dz)/(z + k*z + k*k - 1);
}
return result;
}
static double g(){ return 22.61890999999999962710717227309942245483; }
};
//
// Lanczos Coefficients for N=6 G=1.428456135094165802001953125
// Max experimental error (with arbitrary precision arithmetic) 8.111667e-8
@@ -2883,13 +2687,12 @@ struct lanczos
typename std::conditional<(target_precision <= lanczos11::value), lanczos11,
typename std::conditional<(target_precision <= lanczos17m64::value), lanczos17m64,
typename std::conditional<(target_precision <= lanczos24m113::value), lanczos24m113,
typename std::conditional<(target_precision <= lanczos22::value), lanczos22,
typename std::conditional<(target_precision <= lanczos27MP::value), lanczos27MP,
typename std::conditional<(target_precision <= lanczos35MP::value), lanczos35MP,
typename std::conditional<(target_precision <= lanczos48MP::value), lanczos48MP,
typename std::conditional<(target_precision <= lanczos49MP::value), lanczos49MP,
typename std::conditional<(target_precision <= lanczos52MP::value), lanczos52MP, undefined_lanczos>::type
>::type>::type>::type>::type>::type>::type>::type>::type>::type
>::type>::type>::type>::type>::type>::type>::type>::type
>::type;
};

View File

@@ -414,7 +414,7 @@ namespace boost {
switch(peek_char(it, end, ct)) {
case 'q':
case 's':
if(flags_ && legacy)
if(flags_)
++it;
break; // "nanq", "nans"

View File

@@ -11,8 +11,6 @@
#include <tuple>
#include <type_traits>
#include <stdexcept>
#include <future>
#include <thread>
#include <vector>
#include <algorithm>
#include <cmath>
@@ -22,8 +20,10 @@
// Support compilers with P0024R2 implemented without linking TBB
// https://en.cppreference.com/w/cpp/compiler_support
#ifndef BOOST_NO_CXX17_HDR_EXECUTION
#if !defined(BOOST_NO_CXX17_HDR_EXECUTION) && defined(BOOST_HAS_THREADS)
#include <execution>
#include <future>
#include <thread>
#define EXEC_COMPATIBLE
#endif
@@ -60,6 +60,8 @@ ReturnType means_and_covariance_seq_impl(ForwardIterator u_begin, ForwardIterato
return std::make_tuple(mu_u, mu_v, cov/i, i);
}
#ifdef EXEC_COMPATIBLE
// Numerically stable parallel computation of (co-)variance
// https://dl.acm.org/doi/10.1145/3221269.3223036
template<typename ReturnType, typename ForwardIterator>
@@ -152,6 +154,8 @@ ReturnType means_and_covariance_parallel_impl(ForwardIterator u_begin, ForwardIt
return std::make_tuple(mu_u_a, mu_v_a, cov_a, n_a);
}
#endif // EXEC_COMPATIBLE
template<typename ReturnType, typename ForwardIterator>
ReturnType correlation_coefficient_seq_impl(ForwardIterator u_begin, ForwardIterator u_end, ForwardIterator v_begin, ForwardIterator v_end)
{
@@ -202,6 +206,8 @@ ReturnType correlation_coefficient_seq_impl(ForwardIterator u_begin, ForwardIter
return std::make_tuple(mu_u, Qu, mu_v, Qv, cov, rho, i);
}
#ifdef EXEC_COMPATIBLE
// Numerically stable parallel computation of (co-)variance:
// https://dl.acm.org/doi/10.1145/3221269.3223036
//
@@ -323,6 +329,8 @@ ReturnType correlation_coefficient_parallel_impl(ForwardIterator u_begin, Forwar
return std::make_tuple(mu_u_a, Qu_a, mu_v_a, Qv_a, cov_a, rho, n_a);
}
#endif // EXEC_COMPATIBLE
} // namespace detail
#ifdef EXEC_COMPATIBLE
@@ -417,7 +425,7 @@ inline auto correlation_coefficient(Container const & u, Container const & v)
return correlation_coefficient(std::execution::seq, u, v);
}
#else // C++11 bindings
#else // C++11 and single threaded bindings
template<typename Container, typename Real = typename Container::value_type, typename std::enable_if<std::is_integral<Real>::value, bool>::type = true>
inline auto means_and_covariance(Container const & u, Container const & v) -> std::tuple<double, double, double>

View File

@@ -7,13 +7,11 @@
#ifndef BOOST_MATH_STATISTICS_UNIVARIATE_STATISTICS_DETAIL_SINGLE_PASS_HPP
#define BOOST_MATH_STATISTICS_UNIVARIATE_STATISTICS_DETAIL_SINGLE_PASS_HPP
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/assert.hpp>
#include <tuple>
#include <iterator>
#include <atomic>
#include <thread>
#include <type_traits>
#include <future>
#include <cmath>
#include <algorithm>
#include <valarray>
@@ -21,6 +19,11 @@
#include <functional>
#include <vector>
#ifdef BOOST_HAS_THREADS
#include <future>
#include <thread>
#endif
namespace boost { namespace math { namespace statistics { namespace detail {
template<typename ReturnType, typename ForwardIterator>
@@ -109,6 +112,8 @@ ReturnType first_four_moments_sequential_impl(ForwardIterator first, ForwardIter
return std::make_tuple(M1, M2, M3, M4, n-1);
}
#ifdef BOOST_HAS_THREADS
// https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Higher-order_statistics
// EQN 3.1: https://www.osti.gov/servlets/purl/1426900
template<typename ReturnType, typename ForwardIterator>
@@ -195,6 +200,7 @@ ReturnType first_four_moments_parallel_impl(ForwardIterator first, ForwardIterat
return std::make_tuple(M1_a, M2_a, M3_a, M4_a, elements);
}
#endif // BOOST_HAS_THREADS
// Follows equation 1.5 of:
// https://prod.sandia.gov/techlib-noauth/access-control.cgi/2008/086212.pdf
@@ -276,8 +282,10 @@ ReturnType gini_range_fraction(ForwardIterator first, ForwardIterator last, std:
return std::make_tuple(num, denom, i);
}
#ifdef BOOST_HAS_THREADS
template<typename ReturnType, typename ExecutionPolicy, typename ForwardIterator>
ReturnType gini_coefficient_parallel_impl(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last)
ReturnType gini_coefficient_parallel_impl(ExecutionPolicy&&, ForwardIterator first, ForwardIterator last)
{
using range_tuple = std::tuple<ReturnType, ReturnType, std::size_t>;
@@ -349,6 +357,8 @@ ReturnType gini_coefficient_parallel_impl(ExecutionPolicy&& exec, ForwardIterato
}
}
#endif // BOOST_HAS_THREADS
template<typename ForwardIterator, typename OutputIterator>
OutputIterator mode_impl(ForwardIterator first, ForwardIterator last, OutputIterator output)
{

View File

@@ -22,7 +22,7 @@
// Support compilers with P0024R2 implemented without linking TBB
// https://en.cppreference.com/w/cpp/compiler_support
#ifndef BOOST_NO_CXX17_HDR_EXECUTION
#if !defined(BOOST_NO_CXX17_HDR_EXECUTION) && defined(BOOST_HAS_THREADS)
#include <execution>
namespace boost::math::statistics {

View File

@@ -27,6 +27,7 @@ namespace boost{ namespace math{ namespace tools{
#ifdef BOOST_MATH_NO_LEXICAL_CAST
// This function should not compile, we don't have the necessary functionality to support it:
static_assert(sizeof(Real) == 0, "boost.lexical_cast is not supported in standalone mode.");
(void)p; // Supresses -Wunused-parameter
return Real(0);
#else
return boost::lexical_cast<Real>(p);

View File

@@ -80,42 +80,42 @@ rule all-tests {
local result ;
for local source in [ glob test*.cpp ]
{
result += [ run $(source) /boost/regex//boost_regex /boost/system /boost/filesystem /boost/test//boost_unit_test_framework
result += [ run $(source) /boost/system /boost/filesystem /boost/test//boost_unit_test_framework
: : :
[ check-target-builds has_gsl : <define>ALWAYS_TEST_DOUBLE : ]
<target-os>linux:<linkflags>-lpthread
<target-os>linux:<linkflags>-lrt
<toolset>gcc:<linkflags>$(OTHERFLAGS) ]
;
result += [ run $(source) /boost/regex//boost_regex /boost/system /boost/filesystem /boost/test//boost_unit_test_framework
result += [ run $(source) /boost/system /boost/filesystem /boost/test//boost_unit_test_framework
: : : [ check-target-builds has_cxx17_cmath : <define>TEST_CXX17_CMATH : <build>no ]
<target-os>linux:<linkflags>-lpthread
<target-os>linux:<linkflags>-lrt
<toolset>gcc:<linkflags>$(OTHERFLAGS)
: $(source:B)_cxx17_cmath ]
;
result += [ run $(source) /boost/regex//boost_regex /boost/system /boost/filesystem /boost/test//boost_unit_test_framework
result += [ run $(source) /boost/system /boost/filesystem /boost/test//boost_unit_test_framework
: : : [ check-target-builds has_c99_cmath : <define>TEST_C99 : <build>no ]
<target-os>linux:<linkflags>-lpthread
<target-os>linux:<linkflags>-lrt
<toolset>gcc:<linkflags>$(OTHERFLAGS)
: $(source:B)_c99 ]
;
result += [ run $(source) /boost/regex//boost_regex /boost/system /boost/filesystem /boost/test//boost_unit_test_framework gsl gslcblas
result += [ run $(source) /boost/system /boost/filesystem /boost/test//boost_unit_test_framework gsl gslcblas
: : : [ check-target-builds has_gsl : <define>TEST_GSL : <build>no ]
<target-os>linux:<linkflags>-lpthread
<target-os>linux:<linkflags>-lrt
<toolset>gcc:<linkflags>$(OTHERFLAGS)
: $(source:B)_gsl ]
;
result += [ run $(source) /boost/regex//boost_regex /boost/system /boost/filesystem /boost/test//boost_unit_test_framework Rmath
result += [ run $(source) /boost/system /boost/filesystem /boost/test//boost_unit_test_framework Rmath
: : : [ check-target-builds has_rmath : <define>TEST_RMATH : <build>no ]
<target-os>linux:<linkflags>-lpthread
<target-os>linux:<linkflags>-lrt
<toolset>gcc:<linkflags>$(OTHERFLAGS)
: $(source:B)_rmath ]
;
result += [ run $(source) /boost/regex//boost_regex /boost/system /boost/filesystem /boost/test//boost_unit_test_framework cephes_double
result += [ run $(source) /boost/system /boost/filesystem /boost/test//boost_unit_test_framework cephes_double
: : : [ check-target-builds $(here)/third_party/cephes_double/acosh.c : <define>TEST_CEPHES <source>cephes_double : <build>no ]
<target-os>linux:<linkflags>-lpthread
<target-os>linux:<linkflags>-lrt

View File

@@ -59,7 +59,6 @@ project
# <toolset>msvc:<cxxflags>/wd4506 has no effect?
# suppress xstring(237) : warning C4506: no definition for inline function
<include>../../..
<source>../../regex/build//boost_regex
<exception-handling>off:<source>no_eh
<link>shared:<define>BOOST_REGEX_DYN_LINK=1
# For simplicities sake, make everything a static lib:
@@ -1297,99 +1296,99 @@ test-suite quadrature :
[ run adaptive_gauss_kronrod_quadrature_test.cpp : : : <define>TEST3 [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <linkflags>-lquadmath ]
[ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] <debug-symbols>off <toolset>msvc:<cxxflags>/bigobj release [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : <build>no ] : adaptive_gauss_quadrature_test_3 ]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=1 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_1
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=2 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_2
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=3 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_3
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=4 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_4
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=5 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_5
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=6 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_6
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=7 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_7
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=8 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_8
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=9 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_9
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=10 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_10
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=11 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_11
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=12 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_12
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=13 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_13
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=14 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_14
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=15 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_15
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=16 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_16
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=17 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_17
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=18 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_18
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=19 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_19
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=20 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_20
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=21 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_21
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=22 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_22
]
[ run naive_monte_carlo_test.cpp ../../atomic/build//boost_atomic : : :
[ run naive_monte_carlo_test.cpp : : :
<toolset>msvc:<cxxflags>/bigobj <define>TEST=23 [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" : naive_monte_carlo_test_23
]
[ compile compile_test/quad_naive_monte_carlo_incl_test.cpp ../../atomic/build//boost_atomic :
[ compile compile_test/quad_naive_monte_carlo_incl_test.cpp :
[ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_thread cxx11_hdr_atomic cxx11_decltype cxx11_hdr_future cxx11_hdr_chrono cxx11_hdr_random cxx11_allocator ]
<target-os>linux:<linkflags>"-pthread" [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : <build>no ]
]
@@ -1448,7 +1447,6 @@ rule get_float128_tests
{
result += [ run $(source)
/boost/test//boost_unit_test_framework/<link>static
/boost/regex//boost_regex/<link>static
: # command line
: # input files
: # requirements

View File

@@ -18,75 +18,75 @@ void compile_and_link_test()
#ifdef BOOST_FLOAT128_C
boost::float128_t f128 = 0;
check_result<boost::float128_t>(ldexp(f128, 0));
check_result<boost::float128_t>(frexp(f128, 0));
check_result<boost::float128_t>(std::ldexp(f128, 0));
check_result<boost::float128_t>(std::frexp(f128, 0));
check_result<boost::float128_t>(std::fabs(f128));
check_result<boost::float128_t>(std::abs(f128));
check_result<boost::float128_t>(floor(f128));
check_result<boost::float128_t>(ceil(f128));
check_result<boost::float128_t>(sqrt(f128));
check_result<boost::float128_t>(trunc(f128));
check_result<boost::float128_t>(exp(f128));
check_result<boost::float128_t>(expm1(f128));
check_result<boost::float128_t>(pow(f128, 0));
check_result<boost::float128_t>(log(f128));
check_result<boost::float128_t>(log10(f128));
check_result<boost::float128_t>(sin(f128));
check_result<boost::float128_t>(cos(f128));
check_result<boost::float128_t>(tan(f128));
check_result<boost::float128_t>(asin(f128));
check_result<boost::float128_t>(acos(f128));
check_result<boost::float128_t>(atan(f128));
check_result<boost::float128_t>(sinh(f128));
check_result<boost::float128_t>(cosh(f128));
check_result<boost::float128_t>(tanh(f128));
check_result<boost::float128_t>(asinh(f128));
check_result<boost::float128_t>(acosh(f128));
check_result<boost::float128_t>(atanh(f128));
check_result<boost::float128_t>(fmod(f128, f128));
check_result<boost::float128_t>(atan2(f128, f128));
check_result<boost::float128_t>(lgamma(f128));
check_result<boost::float128_t>(tgamma(f128));
check_result<boost::float128_t>(remainder(f128, f128));
check_result<boost::float128_t>(remquo(f128, f128, 0));
check_result<boost::float128_t>(fma(f128, f128, f128));
check_result<boost::float128_t>(fmax(f128, f128));
check_result<boost::float128_t>(fmin(f128, f128));
check_result<boost::float128_t>(fdim(f128, f128));
check_result<boost::float128_t>(nanq(0));
check_result<boost::float128_t>(exp2(f128));
check_result<boost::float128_t>(log2(f128));
check_result<boost::float128_t>(log1p(f128));
check_result<boost::float128_t>(cbrt(f128));
check_result<boost::float128_t>(hypot(f128, f128));
check_result<boost::float128_t>(erf(f128));
check_result<boost::float128_t>(erfc(f128));
check_result<boost::float128_t>(llround(f128));
check_result<boost::float128_t>(lround(f128));
check_result<boost::float128_t>(round(f128));
check_result<boost::float128_t>(nearbyint(f128));
check_result<boost::float128_t>(llrint(f128));
check_result<boost::float128_t>(lrint(f128));
check_result<boost::float128_t>(rint(f128));
check_result<boost::float128_t>(modf(f128, nullptr));
check_result<boost::float128_t>(scalbln(f128, 0));
check_result<boost::float128_t>(scalbn(f128, 0));
check_result<boost::float128_t>(ilogb(f128));
check_result<boost::float128_t>(logb(f128));
check_result<boost::float128_t>(nextafter(f128, f128));
check_result<boost::float128_t>(nexttoward(f128, f128));
check_result<boost::float128_t>(copysign(f128, f128));
check_result<boost::float128_t>(std::signbit(f128));
check_result<boost::float128_t>(std::fpclassify(f128));
check_result<boost::float128_t>(std::isfinite(f128));
check_result<boost::float128_t>(std::isinf(f128));
check_result<boost::float128_t>(std::isnan(f128));
check_result<boost::float128_t>(std::isnormal(f128));
check_result<boost::float128_t>(std::isgreater(f128, f128));
check_result<boost::float128_t>(std::isgreaterequal(f128, f128));
check_result<boost::float128_t>(std::isless(f128, f128));
check_result<boost::float128_t>(std::islessequal(f128, f128));
check_result<boost::float128_t>(std::islessgreater(f128, f128));
check_result<boost::float128_t>(std::isunordered(f128, f128));
check_result<boost::float128_t>(std::floor(f128));
check_result<boost::float128_t>(std::ceil(f128));
check_result<boost::float128_t>(std::sqrt(f128));
check_result<boost::float128_t>(std::trunc(f128));
check_result<boost::float128_t>(std::exp(f128));
check_result<boost::float128_t>(std::expm1(f128));
check_result<boost::float128_t>(std::pow(f128, 0));
check_result<boost::float128_t>(std::log(f128));
check_result<boost::float128_t>(std::log10(f128));
check_result<boost::float128_t>(std::sin(f128));
check_result<boost::float128_t>(std::cos(f128));
check_result<boost::float128_t>(std::tan(f128));
check_result<boost::float128_t>(std::asin(f128));
check_result<boost::float128_t>(std::acos(f128));
check_result<boost::float128_t>(std::atan(f128));
check_result<boost::float128_t>(std::sinh(f128));
check_result<boost::float128_t>(std::cosh(f128));
check_result<boost::float128_t>(std::tanh(f128));
check_result<boost::float128_t>(std::asinh(f128));
check_result<boost::float128_t>(std::acosh(f128));
check_result<boost::float128_t>(std::atanh(f128));
check_result<boost::float128_t>(std::fmod(f128, f128));
check_result<boost::float128_t>(std::atan2(f128, f128));
check_result<boost::float128_t>(std::lgamma(f128));
check_result<boost::float128_t>(std::tgamma(f128));
check_result<boost::float128_t>(std::remainder(f128, f128));
check_result<boost::float128_t>(std::remquo(f128, f128, 0));
check_result<boost::float128_t>(std::fma(f128, f128, f128));
check_result<boost::float128_t>(std::fmax(f128, f128));
check_result<boost::float128_t>(std::fmin(f128, f128));
check_result<boost::float128_t>(std::fdim(f128, f128));
check_result<boost::float128_t>(std::nanq(0));
check_result<boost::float128_t>(std::exp2(f128));
check_result<boost::float128_t>(std::log2(f128));
check_result<boost::float128_t>(std::log1p(f128));
check_result<boost::float128_t>(std::cbrt(f128));
check_result<boost::float128_t>(std::hypot(f128, f128));
check_result<boost::float128_t>(std::erf(f128));
check_result<boost::float128_t>(std::erfc(f128));
check_result<long long>(std::llround(f128));
check_result<long>(std::lround(f128));
check_result<boost::float128_t>(std::round(f128));
check_result<boost::float128_t>(std::nearbyint(f128));
check_result<long long>(std::llrint(f128));
check_result<long>(std::lrint(f128));
check_result<boost::float128_t>(std::rint(f128));
check_result<boost::float128_t>(std::modf(f128, nullptr));
check_result<boost::float128_t>(std::scalbln(f128, 0));
check_result<boost::float128_t>(std::scalbn(f128, 0));
check_result<int>(std::ilogb(f128));
check_result<boost::float128_t>(std::logb(f128));
check_result<boost::float128_t>(std::nextafter(f128, f128));
check_result<boost::float128_t>(std::nexttoward(f128, f128));
check_result<boost::float128_t>(std::copysign(f128, f128));
check_result<bool>(std::signbit(f128));
check_result<int>(std::fpclassify(f128));
check_result<bool>(std::isfinite(f128));
check_result<bool>(std::isinf(f128));
check_result<bool>(std::isnan(f128));
check_result<bool>(std::isnormal(f128));
check_result<bool>(std::isgreater(f128, f128));
check_result<bool>(std::isgreaterequal(f128, f128));
check_result<bool>(std::isless(f128, f128));
check_result<bool>(std::islessequal(f128, f128));
check_result<bool>(std::islessgreater(f128, f128));
check_result<bool>(std::isunordered(f128, f128));
#endif // boost::float128_t
}

View File

@@ -15,7 +15,7 @@ using boost::math::quadrature::naive_monte_carlo;
void compile_and_link_test()
{
auto g = [&](std::vector<std_real_concept> const & x)
auto g = [&](std::vector<std_real_concept> const &)
{
return 1.873;
};

View File

@@ -19,7 +19,7 @@ void compile_and_link_test()
auto f = [](double x) { return x; };
boost::math::quadrature::ooura_fourier_sin<double> sin_integrator;
boost::math::quadrature::ooura_fourier_cos<double> cos_integrator;
check_result<double>(sin_integrator.integrate(f, 1.0));
check_result<double>(cos_integrator.integrate(f, 1.0));
check_result<std::pair<double, double>>(sin_integrator.integrate(f, 1.0));
check_result<std::pair<double, double>>(cos_integrator.integrate(f, 1.0));
}
#endif

View File

@@ -15,9 +15,9 @@
void compile_and_link_test()
{
check_result<int>(boost::math::rsqrt<float>(f));
check_result<int>(boost::math::rsqrt<double>(d));
check_result<float>(boost::math::rsqrt<float>(f));
check_result<double>(boost::math::rsqrt<double>(d));
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
check_result<int>(boost::math::rsqrt<long double>(l));
check_result<long double>(boost::math::rsqrt<long double>(l));
#endif
}

View File

@@ -29,7 +29,7 @@ inline void check_result_imp(bool, bool){}
//
// If the compiler warns about unused typedefs then enable this:
//
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
#if (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))) || (defined(__clang__) && __clang_major__ > 4)
# define BOOST_MATH_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
#else
# define BOOST_MATH_ASSERT_UNUSED_ATTRIBUTE

View File

@@ -4,20 +4,22 @@
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/math/tools/config.hpp>
#if !defined(BOOST_MATH_NO_THREAD_LOCAL_WITH_NON_TRIVIAL_TYPES) && defined(BOOST_HAS_THREADS)
#include <vector>
#include <atomic>
#include <thread>
#include <random>
#include <algorithm>
#include <iostream>
#include <boost/math/tools/config.hpp>
std::atomic<int> counter{ 0 };
void thread_proc()
{
#ifndef BOOST_MATH_NO_THREAD_LOCAL_WITH_NON_TRIVIAL_TYPES
static thread_local std::vector<double> list;
std::default_random_engine rnd;
@@ -29,7 +31,6 @@ void thread_proc()
++counter;
}
std::sort(list.begin(), list.end());
#endif
}
int main()
@@ -52,3 +53,9 @@ int main()
return counter - 6000;
}
#else
int main() { return 0; }
#endif

View File

@@ -222,6 +222,6 @@ install generate_rational_test_install : generate_rational_test : <location>bin
#}
exe generate_rational_code : generate_rational_code.cpp ;
exe process_perf_results : process_perf_results.cpp ../../regex/build//boost_regex ;
exe process_perf_results : process_perf_results.cpp ;
install bin : generate_rational_code process_perf_results ;