Skip to content

Commit

Permalink
Merge branch 'develop' into pr1007
Browse files Browse the repository at this point in the history
Fixes Conflicts:
	test/test_binomial.cpp
  • Loading branch information
jzmaddock committed Aug 30, 2023
2 parents d967bf7 + 0d941f0 commit 0c4fc70
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 53 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
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
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
2 changes: 1 addition & 1 deletion include/boost/math/tools/big_constant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ inline T make_big_value(largest_float, const char* s, std::false_type const&, st
}
#else
template <typename T>
inline T make_big_value(largest_float, const char* s, std::false_type const&, std::false_type const&)
inline T make_big_value(largest_float, const char*, std::false_type const&, std::false_type const&)
{
static_assert(sizeof(T) == 0, "Type is unsupported in standalone mode. Please disable and try again.");
}
Expand Down
10 changes: 5 additions & 5 deletions include/boost/math/tools/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@
// libstdc++3 only defines to/from_chars for std::float128_t when one of these defines are set
// otherwise we're right out of luck...
# if defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128) || defined(_GLIBCXX_HAVE_FLOAT128_MATH)
# include <cstring> // std::strlen is used with from_chars
# include <charconv>
# include <stdfloat>
# define BOOST_MATH_USE_CHARCONV_FOR_CONVERSION
#endif
# include <cstring> // std::strlen is used with from_chars
# include <charconv>
# include <stdfloat>
# define BOOST_MATH_USE_CHARCONV_FOR_CONVERSION
# endif
# endif
#endif

Expand Down
8 changes: 6 additions & 2 deletions include/boost/math/tools/promotion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
#include <boost/math/tools/config.hpp>
#include <type_traits>

#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
Expand Down
2 changes: 1 addition & 1 deletion test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ test-suite misc :
[ run centered_continued_fraction_test.cpp : : : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <linkflags>-lquadmath ] ]
[ run luroth_expansion_test.cpp : : : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <linkflags>-lquadmath ] ]
[ run engel_expansion_test.cpp : : : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <linkflags>-lquadmath ] ]
[ run test_classify.cpp pch ../../test/build//boost_unit_test_framework ]
[ run test_classify.cpp pch ../../test/build//boost_unit_test_framework : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run test_error_handling.cpp ../../test/build//boost_unit_test_framework ]
[ run legendre_stieltjes_test.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_range_based_for ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <linkflags>-lquadmath ] ]
[ run test_minima.cpp pch ../../test/build//boost_unit_test_framework ]
Expand Down
41 changes: 0 additions & 41 deletions test/test_autodiff_7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,4 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(expm1_hpp, T, all_float_types) {
}
}

BOOST_AUTO_TEST_CASE_TEMPLATE(fpclassify_hpp, T, all_float_types) {
using boost::math::fpclassify;
using boost::math::isfinite;
using boost::math::isinf;
using boost::math::isnan;
using boost::math::isnormal;
using boost::multiprecision::fpclassify;
using boost::multiprecision::isfinite;
using boost::multiprecision::isinf;
using boost::multiprecision::isnan;
using boost::multiprecision::isnormal;

using test_constants = test_constants_t<T>;
static constexpr auto m = test_constants::order;
test_detail::RandomSample<T> x_sampler{-1000, 1000};
for (auto i : boost::irange(test_constants::n_samples)) {
std::ignore = i;

BOOST_CHECK_EQUAL(fpclassify(make_fvar<T, m>(0)), FP_ZERO);
BOOST_CHECK_EQUAL(fpclassify(make_fvar<T, m>(10)), FP_NORMAL);
BOOST_CHECK_EQUAL(
fpclassify(make_fvar<T, m>(std::numeric_limits<T>::infinity())),
FP_INFINITE);
BOOST_CHECK_EQUAL(
fpclassify(make_fvar<T, m>(std::numeric_limits<T>::quiet_NaN())),
FP_NAN);
if (std::numeric_limits<T>::has_denorm != std::denorm_absent) {
BOOST_CHECK_EQUAL(
fpclassify(make_fvar<T, m>(std::numeric_limits<T>::denorm_min())),
FP_SUBNORMAL);
}

BOOST_CHECK(isfinite(make_fvar<T, m>(0)));
BOOST_CHECK(isnormal(make_fvar<T, m>((std::numeric_limits<T>::min)())));
BOOST_CHECK(
!isnormal(make_fvar<T, m>(std::numeric_limits<T>::denorm_min())));
BOOST_CHECK(isinf(make_fvar<T, m>(std::numeric_limits<T>::infinity())));
BOOST_CHECK(isnan(make_fvar<T, m>(std::numeric_limits<T>::quiet_NaN())));
}
}

BOOST_AUTO_TEST_SUITE_END()
15 changes: 15 additions & 0 deletions test/test_classify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <iostream>
#include <iomanip>

#include "test_autodiff.hpp"

#ifdef _MSC_VER
#pragma warning(disable: 4127 4146) // conditional expression is constant
#endif
Expand Down Expand Up @@ -256,6 +258,9 @@ void test_classify(T t, const char* type)
#endif
}


BOOST_AUTO_TEST_SUITE(test_fpclassify)

BOOST_AUTO_TEST_CASE( test_main )
{
BOOST_MATH_CONTROL_FP;
Expand Down Expand Up @@ -288,6 +293,16 @@ BOOST_AUTO_TEST_CASE( test_main )
test_classify(unsigned(0), "unsigned");
}

BOOST_AUTO_TEST_CASE_TEMPLATE(fpclassify_autodiff, T, all_float_types) {
test_classify(boost::math::differentiation::make_fvar<T, 1>(0), "autodiff float");
test_classify(boost::math::differentiation::make_fvar<T, 2>(0), "autodiff float");
test_classify(boost::math::differentiation::make_fvar<T, 3>(0), "autodiff float");
test_classify(boost::math::differentiation::make_fvar<T, 7>(0), "autodiff float");
test_classify(boost::math::differentiation::make_fvar<T, 12>(0), "autodiff float");
}

BOOST_AUTO_TEST_SUITE_END()

/*
Autorun "i:\Boost-sandbox\math_toolkit\libs\math\test\MSVC80\debug\test_classify.exe"
Running 1 test case...
Expand Down

0 comments on commit 0c4fc70

Please sign in to comment.