Skip to content

Commit

Permalink
Merge branch 'develop' into promotion_2
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanelandt authored Aug 26, 2023
2 parents ade489a + 74bb4bc commit 5f53568
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 77 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
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
16 changes: 6 additions & 10 deletions include/boost/math/distributions/detail/inv_discrete_quantile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,13 @@ inline typename Dist::value_type round_to_floor(const Dist& d, typename Dist::va
//
while(result != 0)
{
cc = result - 1;
cc = floor(float_prior(result));
if(cc < support(d).first)
break;
pp = c ? cdf(complement(d, cc)) : cdf(d, cc);
if(pp == p)
result = cc;
else if(c ? pp > p : pp < p)
if(c ? pp > p : pp < p)
break;
result -= 1;
result = cc;
}

return result;
Expand All @@ -336,15 +334,13 @@ inline typename Dist::value_type round_to_ceil(const Dist& d, typename Dist::val
//
while(true)
{
cc = result + 1;
cc = ceil(float_next(result));
if(cc > support(d).second)
break;
pp = c ? cdf(complement(d, cc)) : cdf(d, cc);
if(pp == p)
result = cc;
else if(c ? pp < p : pp > p)
if(c ? pp < p : pp > p)
break;
result += 1;
result = cc;
}

return result;
Expand Down
2 changes: 0 additions & 2 deletions include/boost/math/quadrature/detail/exp_sinh_detail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ auto exp_sinh_detail<Real, Policy>::integrate(const F& f, Real* error, Real* L1,
auto weight_row = get_weight_row(i);

first_j = first_j == 0 ? 0 : 2 * first_j - 1; // appoximate location to start looking for lowest meaningful abscissa value
BOOST_MATH_MAYBE_UNUSED Real abterm1 = 1;
std::size_t j = first_j;
while (abscissas_row[j] < min_abscissa)
++j;
Expand All @@ -237,7 +236,6 @@ auto exp_sinh_detail<Real, Policy>::integrate(const F& f, Real* error, Real* L1,
sum += y*weight_row[j];
Real abterm0 = abs(y)*weight_row[j];
absum += abterm0;
abterm1 = abterm0;
}

I1 += sum*h;
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
17 changes: 0 additions & 17 deletions include/boost/math/tools/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,6 @@
# define BOOST_MATH_EXEC_COMPATIBLE
#endif

// Attributes from C++14 and newer
#ifdef __has_cpp_attribute

// C++17
#if (__cplusplus >= 201703L || _MSVC_LANG >= 201703L)
# if __has_cpp_attribute(maybe_unused)
# define BOOST_MATH_MAYBE_UNUSED [[maybe_unused]]
# endif
#endif

#endif // Standalone config

// If attributes are not defined make sure we don't have compiler errors
#ifndef BOOST_MATH_MAYBE_UNUSED
# define BOOST_MATH_MAYBE_UNUSED
#endif

// C++23
#if __cplusplus > 202002L || _MSVC_LANG > 202002L
# if __GNUC__ >= 13
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()
12 changes: 12 additions & 0 deletions test/test_binomial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,18 @@ void test_spots(RealType T)

check_out_of_range<boost::math::binomial_distribution<RealType> >(1, 1); // (All) valid constructor parameter values.

// TODO: Generic ibeta_power_terms has accuracy issue when long
// double is not precise enough, causing overflow in this case.
if(!std::is_same<RealType, real_concept>::value ||
sizeof(boost::math::concepts::real_concept_base_type) > 8)
{
using namespace boost::math::policies;
typedef policy<discrete_quantile<integer_round_outwards> > Policy;
binomial_distribution<RealType, Policy> dist(9079765771874083840, 0.561815);
// Accuracy is not too important here; the main purpose is to
// make sure it is not stuck.
BOOST_CHECK_CLOSE(quantile(dist, 0.0365346), 5101148604445670400, 1e12);
}

} // template <class RealType>void test_spots(RealType)

Expand Down
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 5f53568

Please sign in to comment.