Skip to content

Commit

Permalink
Merge pull request #1042 from boostorg/develop
Browse files Browse the repository at this point in the history
Merge for 1.84
  • Loading branch information
jzmaddock authored Nov 5, 2023
2 parents 1a7be5d + 11e2348 commit f4c3757
Show file tree
Hide file tree
Showing 58 changed files with 5,676 additions and 341 deletions.
8 changes: 4 additions & 4 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def main(ctx):
#
# Sanitizers:
#
result.append(linux_cxx("Ubuntu g++-10 C++2a ASAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=address <linkflags>-fsanitize=address <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
result.append(linux_cxx("Ubuntu g++-10 C++2a USAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=undefined <linkflags>-fsanitize=undefined <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
result.append(linux_cxx("Ubuntu g++-10 C++2a TSAN" + " " + suite, "g++-10", packages="g++-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=thread <linkflags>-fsanitize=thread <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
result.append(linux_cxx("Ubuntu clang++-10 C++2a ISAN" + " " + suite, "clang++-10", packages="clang-10", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': 'gnu++2a', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=integer <linkflags>-fsanitize=integer' }, globalenv=globalenv))
result.append(linux_cxx("Ubuntu g++-12 C++20 ASAN" + " " + suite, "g++-12", packages="g++-12", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2204:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-12', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=address <linkflags>-fsanitize=address <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
result.append(linux_cxx("Ubuntu g++-12 C++20 USAN" + " " + suite, "g++-12", packages="g++-12", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2204:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-12', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=undefined <linkflags>-fsanitize=undefined <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
result.append(linux_cxx("Ubuntu g++-12 C++20 TSAN" + " " + suite, "g++-12", packages="g++-12", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2204:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-12', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=thread <linkflags>-fsanitize=thread <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
result.append(linux_cxx("Ubuntu clang++-14 C++20 ISAN" + " " + suite, "clang++-14", packages="clang-14", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2204:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-14', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=integer <linkflags>-fsanitize=integer' }, globalenv=globalenv))

for suite in things_to_test:
for cxx in gnu_5_stds:
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fail-fast: false
matrix:
compiler: [ g++-12, clang++-14 ]
standard: [ c++14, c++17, c++20 ]
standard: [ c++14, c++17 ]
suite: [ github_ci_block_1, github_ci_block_2 ]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -181,6 +181,7 @@ jobs:
shell: cmd
env:
ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }}
ARGSLATEST: toolset=${{ matrix.toolset }} address-model=64 cxxstd=latest
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -214,9 +215,14 @@ jobs:
- name: Config info
run: config_info_travis
working-directory: ../boost-root/libs/config/test
- name: Test
- name: Test std-14 vc140 and std-14-17 vc142
if: ${{ matrix.toolset != 'msvc-14.0' || matrix.standard != '17' }}
run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES debug-symbols=off ${{ matrix.suite }} pch=off
working-directory: ../boost-root/libs/math/test
- name: Test std-latest vc140
if: ${{ matrix.toolset == 'msvc-14.0' && matrix.standard == '17' }}
run: ..\..\..\b2 --hash %ARGSLATEST% define=CI_SUPPRESS_KNOWN_ISSUES debug-symbols=off ${{ matrix.suite }} pch=off
working-directory: ../boost-root/libs/math/test
windows_gcc:
runs-on: windows-2019
defaults:
Expand Down Expand Up @@ -270,7 +276,8 @@ jobs:
strategy:
fail-fast: false
matrix:
standard: [ 14, 17, 20 ]
toolset: [ msvc-14.3, clang-win ]
standard: [ 14, 17, latest ]
suite: [ github_ci_block_1, github_ci_block_2 ]
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion doc/fp_utilities/float_next.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ next floating-point value, but `x - u` is not necessarily the previous value. S
value. The corner cases occur at power of 2 boundaries.
* When the argument becomes very small, it may be that there is no floating-point value that
represents one ULP. Whether this is the case or not depends not only on whether the hardware
may ['sometimes] support denormals (as signalled by `std::numeric_limits<FPT>::has_denorm`), but also whether these are
may ['sometimes] support denormals (as signalled by `boost::math::detail::has_denorm_now<FPT>()`), but also whether these are
currently enabled at runtime (for example on SSE hardware, the DAZ or FTZ flags will disable denormal support).
In this situation, the `ulp` function may return a value that is many orders of magnitude too large.

Expand Down
2 changes: 1 addition & 1 deletion doc/sf/lambert_w.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ The domain of /W/[sub -1] is \[-/e/[super -1], 0\). Numerically,
For example, for `double`: lambert_wm1(-2.2250738585072014e-308) = -714.96865723796634 [br]
and for `float`: lambert_wm1(-1.17549435e-38) = -91.8567734 [br]

* `z < -std::numeric_limits<T>::min()`, means that z is zero or denormalized (if `std::numeric_limits<T>::has_denorm_min == true`),
* `z < -std::numeric_limits<T>::min()`, means that z is zero or denormalized (if `boost::math::detail::has_denorm_now<T>() == true`),
for example: `r = lambert_wm1(-std::numeric_limits<double>::denorm_min());` and an overflow_error exception is thrown,
and will give a message like:

Expand Down
6 changes: 4 additions & 2 deletions example/inspect_fp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <boost/math/tools/config.hpp>
#endif

#include <boost/math/special_functions/next.hpp> // for has_denorm_now

//------------------------------------------------------------------------------

bool is_big_endian()
Expand Down Expand Up @@ -111,9 +113,9 @@ template<class T> void print_table()
{
print_row("0", (T)0);
print_row("sn.min", std::numeric_limits<T>::denorm_min(),
std::numeric_limits<T>::has_denorm);
boost::math::detail::has_denorm_now<T>());
print_row("-sn.min", -std::numeric_limits<T>::denorm_min(),
std::numeric_limits<T>::has_denorm);
boost::math::detail::has_denorm_now<T>());
print_row("n.min/256", (std::numeric_limits<T>::min)()/256);
print_row("n.min/2", (std::numeric_limits<T>::min)()/2);
print_row("-n.min/2", -(std::numeric_limits<T>::min)()/2);
Expand Down
13 changes: 3 additions & 10 deletions include/boost/math/ccmath/abs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,13 @@
#ifndef BOOST_MATH_CCMATH_ABS
#define BOOST_MATH_CCMATH_ABS

#include <cmath>
#include <type_traits>
#include <limits>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/tools/assert.hpp>
#include <boost/math/ccmath/detail/config.hpp>
#include <boost/math/ccmath/isnan.hpp>
#include <boost/math/ccmath/isinf.hpp>

#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/abs.hpp> can only be used in C++17 and later."
#endif

namespace boost::math::ccmath {
Expand Down
34 changes: 34 additions & 0 deletions include/boost/math/ccmath/detail/config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// (C) Copyright John Maddock 2023.
// Use, modification and distribution are subject to 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)
//
// Core configuration for ccmath functions, basically will they work or not?

#ifndef BOOST_MATH_CCMATH_DETAIL_CONFIG
#define BOOST_MATH_CCMATH_DETAIL_CONFIG

#include <cmath>
#include <type_traits>
#include <limits>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/tools/is_standalone.hpp>

#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
# define BOOST_MATH_NO_CCMATH
#endif
#endif

#ifndef _MSC_VER
//
// Don't check here for msvc as they didn't get std lib configuration macros at the same time as C++17 <type_traits>
//
#if (__cpp_lib_bool_constant < 201505L) && !defined(BOOST_MATH_NO_CCMATH)
# define BOOST_MATH_NO_CCMATH
#endif
#endif


#endif
12 changes: 3 additions & 9 deletions include/boost/math/ccmath/div.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,12 @@
#ifndef BOOST_MATH_CCMATH_DIV_HPP
#define BOOST_MATH_CCMATH_DIV_HPP

#include <cmath>
#include <cstdlib>
#include <cinttypes>
#include <cstdint>
#include <type_traits>
#include <boost/math/ccmath/detail/config.hpp>

#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/div.hpp> can only be used in C++17 and later."
#endif

namespace boost::math::ccmath {
Expand Down
13 changes: 3 additions & 10 deletions include/boost/math/ccmath/fma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@
#ifndef BOOST_MATH_CCMATH_FMA_HPP
#define BOOST_MATH_CCMATH_FMA_HPP

#include <cmath>
#include <limits>
#include <type_traits>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/ccmath/detail/config.hpp>
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>

#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/fma.hpp> can only be used in C++17 and later."
#endif

namespace boost::math::ccmath {
Expand Down
13 changes: 3 additions & 10 deletions include/boost/math/ccmath/isinf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@
#ifndef BOOST_MATH_CCMATH_ISINF
#define BOOST_MATH_CCMATH_ISINF

#include <cmath>
#include <limits>
#include <type_traits>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/ccmath/detail/config.hpp>

#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/isinf.hpp> can only be used in C++17 and later."
#endif

namespace boost::math::ccmath {
Expand Down
12 changes: 3 additions & 9 deletions include/boost/math/ccmath/isnan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@
#ifndef BOOST_MATH_CCMATH_ISNAN
#define BOOST_MATH_CCMATH_ISNAN

#include <cmath>
#include <type_traits>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/ccmath/detail/config.hpp>

#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/isnan.hpp> can only be used in C++17 and later."
#endif

namespace boost::math::ccmath {
Expand Down
13 changes: 3 additions & 10 deletions include/boost/math/ccmath/isnormal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,13 @@
#ifndef BOOST_MATH_ISNORMAL_HPP
#define BOOST_MATH_ISNORMAL_HPP

#include <cmath>
#include <limits>
#include <type_traits>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/ccmath/detail/config.hpp>
#include <boost/math/ccmath/abs.hpp>
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>

#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/abs.hpp> can only be used in C++17 and later."
#endif

namespace boost::math::ccmath {
Expand Down
5 changes: 1 addition & 4 deletions include/boost/math/ccmath/ldexp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
#ifndef BOOST_MATH_CCMATH_LDEXP_HPP
#define BOOST_MATH_CCMATH_LDEXP_HPP

#include <cmath>
#include <limits>
#include <type_traits>
#include <stdexcept>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/ccmath/detail/config.hpp>
#include <boost/math/ccmath/abs.hpp>
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/boost/math/ccmath/next.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ constexpr T get_smallest_value(const std::false_type&)
template <typename T>
constexpr T get_smallest_value()
{
return get_smallest_value<T>(std::integral_constant<bool, std::numeric_limits<T>::is_specialized && (std::numeric_limits<T>::has_denorm == std::denorm_present)>());
return get_smallest_value<T>(std::integral_constant<bool, std::numeric_limits<T>::is_specialized>());
}

template <typename T>
Expand Down
12 changes: 3 additions & 9 deletions include/boost/math/ccmath/round.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,15 @@
#ifndef BOOST_MATH_CCMATH_ROUND_HPP
#define BOOST_MATH_CCMATH_ROUND_HPP

#include <cmath>
#include <type_traits>
#include <stdexcept>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/ccmath/detail/config.hpp>
#include <boost/math/ccmath/abs.hpp>
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>
#include <boost/math/ccmath/modf.hpp>

#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/round.hpp> can only be used in C++17 and later."
#endif

namespace boost::math::ccmath {
Expand Down
13 changes: 3 additions & 10 deletions include/boost/math/ccmath/signbit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,15 @@
#ifndef BOOST_MATH_CCMATH_SIGNBIT_HPP
#define BOOST_MATH_CCMATH_SIGNBIT_HPP

#include <cmath>
#include <cstdint>
#include <limits>
#include <type_traits>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/tools/assert.hpp>
#include <boost/math/ccmath/detail/config.hpp>
#include <boost/math/special_functions/detail/fp_traits.hpp>
#include <boost/math/ccmath/isnan.hpp>
#include <boost/math/ccmath/abs.hpp>

#include <boost/math/tools/is_standalone.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/config.hpp>
#ifdef BOOST_NO_CXX17_IF_CONSTEXPR
#error "The header <boost/math/norms.hpp> can only be used in C++17 and later."
#endif
#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/signbit.hpp> can only be used in C++17 and later."
#endif

#ifdef __has_include
Expand Down
8 changes: 6 additions & 2 deletions include/boost/math/concepts/real_concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@
# include <cstdio>
#endif

#if __has_include(<stdfloat>)
# include <stdfloat>
#if defined __has_include
# if __cplusplus > 202002L || _MSVC_LANG > 202002L
# if __has_include (<stdfloat>)
# include <stdfloat>
# endif
# endif
#endif

namespace boost{ namespace math{
Expand Down
Loading

0 comments on commit f4c3757

Please sign in to comment.