Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge ccmath updates to master #1047

Merged
merged 5 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: cp -r $GITHUB_WORKSPACE/* libs/math
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py math
run: python tools/boostdep/depinst/depinst.py math -I example -I tools
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
run: cp -r $GITHUB_WORKSPACE/* libs/math
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py math
run: python tools/boostdep/depinst/depinst.py math -I example -I tools
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
run: cp -r $GITHUB_WORKSPACE/* libs/math
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py math
run: python tools/boostdep/depinst/depinst.py math -I example -I tools
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\math
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py math
run: python tools/boostdep/depinst/depinst.py math -I example -I tools
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\math
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py math
run: python tools/boostdep/depinst/depinst.py math -I example -I tools
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
Expand Down Expand Up @@ -292,7 +292,7 @@ jobs:
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\math
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py math
run: python tools/boostdep/depinst/depinst.py math -I example -I tools
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
Expand Down Expand Up @@ -336,7 +336,7 @@ jobs:
- name: Copy files
run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && cp -r * ../boost-root/libs/math'
- name: Install deps
run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && python tools/boostdep/depinst/depinst.py math'
run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && python tools/boostdep/depinst/depinst.py math -I example -I tools'
- name: Bootstrap
run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && ./bootstrap.sh'
- name: Generate headers
Expand Down Expand Up @@ -466,7 +466,7 @@ jobs:
run: cp -r $GITHUB_WORKSPACE/* libs/math
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py math
run: python tools/boostdep/depinst/depinst.py math -I example -I tools
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
Expand Down
7 changes: 4 additions & 3 deletions include/boost/math/ccmath/abs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
#ifndef BOOST_MATH_CCMATH_ABS
#define BOOST_MATH_CCMATH_ABS

#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>

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/abs.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/tools/assert.hpp>
#include <boost/math/ccmath/isnan.hpp>
#include <boost/math/ccmath/isinf.hpp>

namespace boost::math::ccmath {

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

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

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/ceil.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/ccmath/floor.hpp>
#include <boost/math/ccmath/abs.hpp>
#include <boost/math/ccmath/isinf.hpp>
Expand Down
18 changes: 18 additions & 0 deletions include/boost/math/ccmath/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,28 @@
#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

#else // BOOST_MATH_STANDALONE

#if defined(_MSC_VER)

#if defined(_MSVC_LANG) && (_MSVC_LANG < 201703)
# define BOOST_MATH_NO_CCMATH
#endif

#else // _MSC_VER

#if (__cplusplus < 201703)
# define BOOST_MATH_NO_CCMATH
#endif

#endif

#endif

#ifndef _MSC_VER
Expand Down
6 changes: 6 additions & 0 deletions include/boost/math/ccmath/fabs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
#ifndef BOOST_MATH_CCMATH_FABS
#define BOOST_MATH_CCMATH_FABS

#include <boost/math/ccmath/detail/config.hpp>

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/fabs.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/ccmath/abs.hpp>

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

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

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/fdim.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/tools/promotion.hpp>
#include <boost/math/ccmath/isnan.hpp>

Expand Down
10 changes: 6 additions & 4 deletions include/boost/math/ccmath/floor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
#ifndef BOOST_MATH_CCMATH_FLOOR_HPP
#define BOOST_MATH_CCMATH_FLOOR_HPP

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

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/floor.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/ccmath/abs.hpp>
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>
Expand Down
5 changes: 3 additions & 2 deletions include/boost/math/ccmath/fma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
#define BOOST_MATH_CCMATH_FMA_HPP

#include <boost/math/ccmath/detail/config.hpp>
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/fma.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>

namespace boost::math::ccmath {

namespace detail {
Expand Down
10 changes: 6 additions & 4 deletions include/boost/math/ccmath/fmax.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
#ifndef BOOST_MATH_CCMATH_FMAX_HPP
#define BOOST_MATH_CCMATH_FMAX_HPP

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

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/fmax.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/tools/promotion.hpp>
#include <boost/math/ccmath/isnan.hpp>

Expand Down
10 changes: 6 additions & 4 deletions include/boost/math/ccmath/fmin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
#ifndef BOOST_MATH_CCMATH_FMIN_HPP
#define BOOST_MATH_CCMATH_FMIN_HPP

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

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/fmin.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/tools/promotion.hpp>
#include <boost/math/ccmath/isnan.hpp>

Expand Down
10 changes: 6 additions & 4 deletions include/boost/math/ccmath/fmod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
#ifndef BOOST_MATH_CCMATH_FMOD_HPP
#define BOOST_MATH_CCMATH_FMOD_HPP

#include <cmath>
#include <boost/math/ccmath/detail/config.hpp>

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/fmod.hpp> can only be used in C++17 and later."
#endif

#include <cstdint>
#include <limits>
#include <type_traits>
#include <boost/math/tools/promotion.hpp>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/ccmath/abs.hpp>
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>
Expand Down
10 changes: 6 additions & 4 deletions include/boost/math/ccmath/fpclassify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
#ifndef BOOST_MATH_CCMATH_FPCLASSIFY
#define BOOST_MATH_CCMATH_FPCLASSIFY

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

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/fpclassify.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/ccmath/abs.hpp>
#include <boost/math/ccmath/isinf.hpp>
Expand Down
9 changes: 6 additions & 3 deletions include/boost/math/ccmath/frexp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
#ifndef BOOST_MATH_CCMATH_FREXP_HPP
#define BOOST_MATH_CCMATH_FREXP_HPP

#include <cmath>
#include <limits>
#include <type_traits>
#include <boost/math/ccmath/detail/config.hpp>

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/frexp.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>
#include <boost/math/ccmath/isfinite.hpp>
Expand Down
10 changes: 6 additions & 4 deletions include/boost/math/ccmath/hypot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
#ifndef BOOST_MATH_CCMATH_HYPOT_HPP
#define BOOST_MATH_CCMATH_HYPOT_HPP

#include <cmath>
#include <boost/math/ccmath/detail/config.hpp>

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/hypot.hpp> can only be used in C++17 and later."
#endif

#include <array>
#include <limits>
#include <type_traits>
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/tools/promotion.hpp>
#include <boost/math/ccmath/sqrt.hpp>
#include <boost/math/ccmath/abs.hpp>
Expand Down
9 changes: 6 additions & 3 deletions include/boost/math/ccmath/ilogb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
#ifndef BOOST_MATH_CCMATH_ILOGB_HPP
#define BOOST_MATH_CCMATH_ILOGB_HPP

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

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/ilogb.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/ccmath/logb.hpp>
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>
Expand Down
17 changes: 6 additions & 11 deletions include/boost/math/ccmath/isfinite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@
#ifndef BOOST_MATH_CCMATH_ISFINITE
#define BOOST_MATH_CCMATH_ISFINITE

#include <cmath>
#include <type_traits>
#include <boost/math/tools/is_constant_evaluated.hpp>
#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.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/isfinite.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/ccmath/isinf.hpp>
#include <boost/math/ccmath/isnan.hpp>

namespace boost::math::ccmath {

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

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

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/isgreater.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/ccmath/isnan.hpp>

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

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

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/islessequal.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/ccmath/isnan.hpp>

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

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

#ifdef BOOST_MATH_NO_CCMATH
#error "The header <boost/math/isless.hpp> can only be used in C++17 and later."
#endif

#include <boost/math/ccmath/isnan.hpp>

namespace boost::math::ccmath {
Expand Down
Loading