Skip to content

Commit 85e2a55

Browse files
committed
Merge branch 'develop'
2 parents 2b99278 + 7df6a28 commit 85e2a55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2171
-310
lines changed

Diff for: .drone.star

+14-7
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ windowsglobalimage="cppalliance/dronevs2019"
1616
def main(ctx):
1717

1818
things_to_test = [ "special_fun", "distribution_tests", "mp", "misc", "interpolators", "quadrature", "autodiff", "long-running-tests", "float128_tests" ]
19-
sanitizer_test = [ "special_fun", "distribution_tests", "misc", "interpolators", "quadrature", "autodiff", "float128_tests" ]
20-
gnu_5_stds = [ "gnu++11" ]
21-
gnu_6_stds = [ "gnu++11", "gnu++14" ]
22-
gnu_8_stds = [ "gnu++11", "gnu++14", "gnu++17" ]
23-
gnu_10_stds = [ "gnu++11", "gnu++14", "gnu++17", "gnu++20" ]
19+
sanitizer_test = [ "special_fun", "distribution_tests", "misc", "interpolators", "quadrature", "float128_tests" ]
20+
gnu_5_stds = [ "gnu++11", "c++11", "gnu++14", "c++14" ]
21+
gnu_6_stds = [ "gnu++11", "c++11", "gnu++14", "c++14", "gnu++17", "c++17" ]
22+
clang_6_stds = [ "c++11", "c++14", "c++17" ]
23+
gnu_9_stds = [ "gnu++14", "c++14", "gnu++17", "c++17", "gnu++2a", "c++2a" ]
24+
clang_10_stds = [ "c++14", "c++17", "c++2a" ]
2425

2526
result = []
2627

@@ -38,12 +39,18 @@ def main(ctx):
3839
result.append(linux_cxx("Ubunti g++-5 " + cxx + " " + suite, "g++-5", packages="g++-5", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
3940
for cxx in gnu_6_stds:
4041
result.append(linux_cxx("Ubunti g++-6 " + cxx + " " + suite, "g++-6", packages="g++-6", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
41-
for cxx in gnu_8_stds:
42+
result.append(linux_cxx("Ubunti g++-7 " + cxx + " " + suite, "g++-7", packages="g++-7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
4243
result.append(linux_cxx("Ubunti g++-8 " + cxx + " " + suite, "g++-8", packages="g++-8", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
4344
result.append(linux_cxx("Ubunti g++-9 " + cxx + " " + suite, "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
45+
for cxx in clang_6_stds:
46+
result.append(linux_cxx("Ubunti clang++-6 " + cxx + " " + suite, "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
47+
result.append(linux_cxx("Ubunti clang++-7 " + cxx + " " + suite, "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
48+
result.append(linux_cxx("Ubunti clang++-8 " + cxx + " " + suite, "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
4449
result.append(linux_cxx("Ubunti clang++-9 " + cxx + " " + suite, "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
45-
for cxx in gnu_10_stds:
50+
for cxx in gnu_9_stds:
4651
result.append(linux_cxx("Ubunti g++-10 " + cxx + " " + suite, "g++-10", packages="g++-10", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
52+
result.append(linux_cxx("Ubunti g++-11 " + cxx + " " + suite, "g++-11", packages="g++-11", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-11', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
53+
for cxx in clang_10_stds:
4754
result.append(linux_cxx("Ubunti clang++-10 " + cxx + " " + suite, "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
4855

4956
return result

Diff for: .github/workflows/ci.yml

+68-21
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ on:
1313
release:
1414
types: [published, created, edited]
1515
jobs:
16-
ubuntu-focal:
17-
runs-on: ubuntu-20.04
16+
ubuntu-jammy:
17+
runs-on: ubuntu-22.04
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
compiler: [ g++-9, g++-11, clang++-10 ]
22-
standard: [ c++11, c++14, c++17, c++2a ]
23-
suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ]
21+
compiler: [ g++-12, clang++-14 ]
22+
standard: [ c++14, c++17, c++20 ]
23+
suite: [ github_ci_block_1, github_ci_block_2 ]
2424
steps:
2525
- uses: actions/checkout@v2
2626
with:
@@ -47,7 +47,7 @@ jobs:
4747
if: steps.retry1.outcome=='failure'
4848
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
4949
- name: Install packages
50-
run: sudo apt install g++-9 g++-11 clang-9 clang-10 libgmp-dev libmpfr-dev libfftw3-dev
50+
run: sudo apt install g++-12 clang-14 libgmp-dev libmpfr-dev libfftw3-dev
5151
- name: Checkout main boost
5252
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
5353
- name: Update tools/boostdep
@@ -75,16 +75,15 @@ jobs:
7575
run: ./config_info_travis
7676
working-directory: ../boost-root/libs/config/test
7777
- name: Test
78-
run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER
78+
run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER
7979
working-directory: ../boost-root/libs/math/test
80-
ubuntu-bionic:
81-
runs-on: ubuntu-18.04
80+
ubuntu-focal-no-eh:
81+
runs-on: ubuntu-20.04
8282
strategy:
8383
fail-fast: false
8484
matrix:
85-
compiler: [ g++-6, clang++-6.0, g++-7, g++-8, clang++-7, clang++-8 ]
86-
standard: [ c++11, c++14, c++17 ]
87-
suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ]
85+
compiler: [ g++-9, g++-11, clang++-10 ]
86+
standard: [ c++11, c++14, c++17, c++2a ]
8887
steps:
8988
- uses: actions/checkout@v2
9089
with:
@@ -111,7 +110,7 @@ jobs:
111110
if: steps.retry1.outcome=='failure'
112111
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
113112
- name: Install packages
114-
run: sudo apt install g++-6 g++-7 g++-8 clang-6.0 clang-7 clang-8 libgmp-dev libmpfr-dev libfftw3-dev
113+
run: sudo apt install g++-9 g++-11 clang-9 clang-10 libgmp-dev libmpfr-dev libfftw3-dev
115114
- name: Checkout main boost
116115
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
117116
- name: Update tools/boostdep
@@ -139,16 +138,16 @@ jobs:
139138
run: ./config_info_travis
140139
working-directory: ../boost-root/libs/config/test
141140
- name: Test
142-
run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER
141+
run: ../../../b2 toolset=$TOOLSET no_eh_tests exception-handling=off rtti=off define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER
143142
working-directory: ../boost-root/libs/math/test
144143
macos:
145144
runs-on: macos-latest
146145
strategy:
147146
fail-fast: false
148147
matrix:
149148
toolset: [ clang ]
150-
standard: [ 11, 14, 17, 2a ]
151-
suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ]
149+
standard: [ 11, 14, 17, 20 ]
150+
suite: [ github_ci_block_1, github_ci_block_2 ]
152151
steps:
153152
- uses: actions/checkout@v2
154153
with:
@@ -194,8 +193,56 @@ jobs:
194193
strategy:
195194
fail-fast: false
196195
matrix:
197-
toolset: [ gcc, msvc-14.0, msvc-14.2 ]
198-
standard: [ 11, 14, 17 ]
196+
toolset: [ msvc-14.0, msvc-14.2 ]
197+
standard: [ 14, 17 ]
198+
suite: [ github_ci_block_1, github_ci_block_2 ]
199+
steps:
200+
- uses: actions/checkout@v2
201+
with:
202+
fetch-depth: '0'
203+
- uses: mstachniuk/ci-skip@v1
204+
with:
205+
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX];[standalone];[STANDALONE];[cygwin];[CYGWIN]'
206+
commit-filter-separator: ';'
207+
fail-fast: true
208+
- name: Checkout main boost
209+
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
210+
- name: Update tools/boostdep
211+
run: git submodule update --init tools/boostdep
212+
working-directory: ../boost-root
213+
- name: Copy files
214+
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\math
215+
working-directory: ../boost-root
216+
- name: Install deps
217+
run: python tools/boostdep/depinst/depinst.py math
218+
working-directory: ../boost-root
219+
- name: Bootstrap
220+
run: bootstrap
221+
working-directory: ../boost-root
222+
- name: Generate headers
223+
run: b2 headers
224+
working-directory: ../boost-root
225+
- name: Config info install
226+
run: ..\..\..\b2 config_info_travis_install %ARGS%
227+
working-directory: ../boost-root/libs/config/test
228+
- name: Config info
229+
run: config_info_travis
230+
working-directory: ../boost-root/libs/config/test
231+
- name: Test
232+
run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }}
233+
working-directory: ../boost-root/libs/math/test
234+
windows_gcc:
235+
runs-on: windows-2019
236+
defaults:
237+
run:
238+
shell: cmd
239+
env:
240+
ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }}
241+
strategy:
242+
fail-fast: false
243+
matrix:
244+
toolset: [ gcc ]
245+
standard: [ 14, 17 ]
199246
suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ]
200247
steps:
201248
- uses: actions/checkout@v2
@@ -243,7 +290,7 @@ jobs:
243290
fail-fast: false
244291
matrix:
245292
standard: [ 14, 17, 20 ]
246-
suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ]
293+
suite: [ github_ci_block_1, github_ci_block_2 ]
247294
steps:
248295
- uses: actions/checkout@v2
249296
with:
@@ -415,8 +462,8 @@ jobs:
415462
fail-fast: false
416463
matrix:
417464
compiler: [ g++-10 ]
418-
standard: [ c++11, c++14, c++17, c++2a ]
419-
suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, interpolators, autodiff, ../example//examples, ../tools ]
465+
standard: [ c++14, c++17, c++20 ]
466+
suite: [ github_ci_block_1, github_ci_block_2 ]
420467
steps:
421468
- uses: actions/checkout@v2
422469
with:

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ Makefile
2424
**CTestTestfile.cmake
2525
DartConfiguration.tcl
2626
cmake-build-debug/*
27+
.cmake/*
28+
build.ninja
29+
.ninja*

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Boost Math Library
22
[![Build Status](https://drone.cpp.al/api/badges/boostorg/math/status.svg)](https://drone.cpp.al/boostorg/math)[![Build Status](https://github.com/boostorg/math/workflows/CI/badge.svg?branch=develop)](https://github.com/boostorg/math/actions)
33
==================
44

5-
>ANNOUNCEMENT: Support for C++03 is now deprecated in this library and will be supported in existing features
6-
>only until March 2021. New features will require *at least* C++11, as will existing features from next year.
5+
>ANNOUNCEMENT: Support for C++11 will be deprecated in this library starting in July 2023 (Boost 1.82).
6+
>New features will require *at least* C++14, as will existing features starting with the deprecation release.
77
88
This library is divided into several interconnected parts:
99

Diff for: doc/sf/ccmath.qbk

+7
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ All of the following functions require C++17 or greater.
182182
template <typename T>
183183
inline constexpr bool isunordered(T x, T y) noexcept
184184

185+
template <typename Real>
186+
inline constexpr Real fma(Real x, Real y, Real z) noexcept
187+
Requires compiling with fma flag
188+
189+
template <typename Arithmetic1, typename Arithmetic2, typename Arithmetic3>
190+
inline constepxr Promoted fma(Arithmetic1 x, Arithmetic2 y, Arithmetic3 z) noexcept
191+
185192
} // Namespaces
186193

187194
[endsect] [/section:ccmath Constexpr CMath]

Diff for: doc/statistics/chatterjee_correlation.qbk

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
[/
2+
Copyright 2022 Matt Borland
3+
4+
Distributed under the Boost Software License, Version 1.0.
5+
(See accompanying file LICENSE_1_0.txt or copy at
6+
http://www.boost.org/LICENSE_1_0.txt).
7+
]
8+
9+
[section:chatterjee_correlation Chatterjee Correlation]
10+
11+
[heading Synopsis]
12+
13+
``
14+
#include <boost/math/statistics/chatterjee_correlation.hpp>
15+
16+
namespace boost::math::statistics {
17+
18+
C++17:
19+
template <typename ExecutionPolicy, typename Container>
20+
auto chatterjee_correlation(ExecutionPolicy&& exec, const Container& u, const Container& v);
21+
22+
C++11:
23+
template <typename Container>
24+
auto chatterjee_correlation(const Container& u, const Container& v);
25+
}
26+
``
27+
28+
[heading Description]
29+
30+
The classical correlation coefficients like the Pearson's correlation are useful primarily for distinguishing when one dataset depends linearly on another.
31+
However, Pearson's correlation coefficient has a known weakness in that when the dependent variable has an obvious functional relationship with the independent variable, the value of the correlation coefficient can take on any value.
32+
As Chatterjee says:
33+
34+
> Ideally, one would like a coefficient that approaches
35+
its maximum value if and only if one variable looks more and more like a
36+
noiseless function of the other, just as Pearson correlation is close to its maximum value if and only if one variable is close to being a noiseless linear function of the other.
37+
38+
This is the problem Chatterjee's coefficient solves.
39+
Let X and Y be random variables, where Y is not constant, and let (X_i, Y_i) be samples from this distribution.
40+
Rearrange these samples so that X_(0) < X_{(1)} < ... X_{(n-1)} and create (R(X_{(i)}), R(Y_{(i)})).
41+
The Chatterjee correlation is then given by
42+
43+
[$../equations/chatterjee_correlation.svg]
44+
45+
In the limit of an infinite amount of i.i.d data, the statistic lies in [0, 1].
46+
However, if the data is not infinite, the statistic may be negative.
47+
If X and Y are independent, the value is zero, and if Y is a measurable function of X, then the statistic is unity.
48+
The complexity is O(n log n).
49+
50+
An example is given below:
51+
52+
std::vector<double> X{1,2,3,4,5};
53+
std::vector<double> Y{1,2,3,4,5};
54+
using boost::math::statistics::chatterjee_correlation;
55+
double coeff = chatterjee_correlation(X, Y);
56+
57+
The implementation follows [@https://arxiv.org/pdf/1909.10140.pdf Chatterjee's paper].
58+
59+
/Nota bene:/ If the input is an integer type the output will be a double precision type.
60+
61+
[heading Invariants]
62+
63+
The function expects at least two samples, a non-constant vector Y, and the same number of X's as Y's.
64+
If Y is constant, the result is a quiet NaN.
65+
The data set must be sorted by X values.
66+
If there are ties in the values of X, then the statistic is random due to the random breaking of ties.
67+
Of course, random numbers are not used internally, but the result is not guaranteed to be identical on different systems.
68+
69+
[heading References]
70+
71+
* Chatterjee, Sourav. "A new coefficient of correlation." Journal of the American Statistical Association 116.536 (2021): 2009-2022.
72+
73+
[endsect]
74+
[/section:chatterjee_correlation Chatterjee Correlation]

Diff for: example/dot_net_example/distribution_explorer/readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Statistical Distribution Explorer
33
Paul A. Bristow
44
John Maddock
55

6-
Copyright 2008 , 2009, 2010, 2012 Paul A. Bristow, John Maddock
6+
Copyright (C) 2008, 2009, 2010, 2012 Paul A. Bristow, John Maddock
77

88
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
99

Diff for: example/policy_eg_1.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ using boost::math::policies::policy;
2121
using boost::math::policies::evaluation_error;
2222
using boost::math::policies::domain_error;
2323
using boost::math::policies::overflow_error;
24-
using boost::math::policies::domain_error;
24+
using boost::math::policies::underflow_error;
2525
using boost::math::policies::pole_error;
2626
// Actions on error (in enum error_policy_type):
2727
using boost::math::policies::errno_on_error;

Diff for: include/boost/math/ccmath/ccmath.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@
3838
#include <boost/math/ccmath/isless.hpp>
3939
#include <boost/math/ccmath/islessequal.hpp>
4040
#include <boost/math/ccmath/isunordered.hpp>
41+
#include <boost/math/ccmath/fma.hpp>
4142

4243
#endif // BOOST_MATH_CCMATH_HPP

0 commit comments

Comments
 (0)