From 544258569b9d4a219a728cffa5ceefb121cbf5e2 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 30 Mar 2021 11:04:16 +0100 Subject: [PATCH] Fixes for inspect failures in doc/ and example/ --- doc/distributions/kolmogorov_smirnov.qbk | 7 ++++ .../hypergeometric_1f1/boost-no-inspect | 1 + doc/math.css | 2 ++ example/CMakeLists.txt | 4 +++ example/airy_ulps_plot.cpp | 5 +++ example/centered_continued_fraction.cpp | 5 +++ .../bootstrap_chebyshev.cpp | 7 +++- .../daubechies_scaling_integer_grid.cpp | 4 +++ .../daubechies_scaling_memory_occupation.cpp | 5 +++ .../regress_daubechies_accuracy.cpp | 36 +++++++++++-------- example/reciprocal_fibonacci_constant.cpp | 2 +- example/to_continued_fraction.cpp | 5 +++ 12 files changed, 67 insertions(+), 16 deletions(-) create mode 100644 doc/graphs/hypergeometric_1f1/boost-no-inspect diff --git a/doc/distributions/kolmogorov_smirnov.qbk b/doc/distributions/kolmogorov_smirnov.qbk index c557f6fc4..a748ece69 100644 --- a/doc/distributions/kolmogorov_smirnov.qbk +++ b/doc/distributions/kolmogorov_smirnov.qbk @@ -120,3 +120,10 @@ When 2*x*x*n > [pi]: -__jacobi_theta4m1tau(0, 2*x*x*n/[pi])]] ] [endsect] [/section:kolmogorov_smirnov_dist Kolmogorov-Smirnov] + +[/ + Copyright Evan Miller 2020. + 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). +] diff --git a/doc/graphs/hypergeometric_1f1/boost-no-inspect b/doc/graphs/hypergeometric_1f1/boost-no-inspect new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/doc/graphs/hypergeometric_1f1/boost-no-inspect @@ -0,0 +1 @@ + diff --git a/doc/math.css b/doc/math.css index 6d0098083..cb5ea2e75 100644 --- a/doc/math.css +++ b/doc/math.css @@ -23,6 +23,8 @@ one in libs/math/doc and one in libs/math/doc/html ONLY EVER EDIT THE FIRST OF THESE !!!! +boost-no-inspect + =============================================================================*/ /*============================================================================= diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index be38f6f9f..cb38cc955 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright 2021 Matt Borland +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt + file(GLOB SOURCES "*.cpp") add_library(examples ${SOURCES}) target_compile_features(examples PRIVATE cxx_std_17) diff --git a/example/airy_ulps_plot.cpp b/example/airy_ulps_plot.cpp index 695d49287..1beccadb9 100644 --- a/example/airy_ulps_plot.cpp +++ b/example/airy_ulps_plot.cpp @@ -2,6 +2,11 @@ // 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) +// +// Deliberately contains some unicode characters: +// +// boost-no-inspect + #include #include #include diff --git a/example/centered_continued_fraction.cpp b/example/centered_continued_fraction.cpp index 70663af83..6d357d2b9 100644 --- a/example/centered_continued_fraction.cpp +++ b/example/centered_continued_fraction.cpp @@ -2,6 +2,11 @@ // 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) +// +// Deliberately contains some unicode characters: +// +// boost-no-inspect +// #include #include #include diff --git a/example/daubechies_wavelets/bootstrap_chebyshev.cpp b/example/daubechies_wavelets/bootstrap_chebyshev.cpp index b158fabcd..927a15b98 100644 --- a/example/daubechies_wavelets/bootstrap_chebyshev.cpp +++ b/example/daubechies_wavelets/bootstrap_chebyshev.cpp @@ -1,3 +1,8 @@ +// (C) Copyright Nick Thompson 2020. +// 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) + #include #include #include @@ -15,4 +20,4 @@ void bootstrap() int main() { bootstrap(); -} \ No newline at end of file +} diff --git a/example/daubechies_wavelets/daubechies_scaling_integer_grid.cpp b/example/daubechies_wavelets/daubechies_scaling_integer_grid.cpp index e376560f4..393823aff 100644 --- a/example/daubechies_wavelets/daubechies_scaling_integer_grid.cpp +++ b/example/daubechies_wavelets/daubechies_scaling_integer_grid.cpp @@ -3,6 +3,10 @@ * 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) + * + * We want to use c-style asserts in examples: + * + * boost-no-inspect */ #define BOOST_MATH_GENERATE_DAUBECHIES_GRID diff --git a/example/daubechies_wavelets/daubechies_scaling_memory_occupation.cpp b/example/daubechies_wavelets/daubechies_scaling_memory_occupation.cpp index 43ae80779..2ffee3f23 100644 --- a/example/daubechies_wavelets/daubechies_scaling_memory_occupation.cpp +++ b/example/daubechies_wavelets/daubechies_scaling_memory_occupation.cpp @@ -1,3 +1,8 @@ +// (C) Copyright Nick Thompson 2020. +// 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) + #include #include #include diff --git a/example/daubechies_wavelets/regress_daubechies_accuracy.cpp b/example/daubechies_wavelets/regress_daubechies_accuracy.cpp index d7b0f3297..a033f8170 100644 --- a/example/daubechies_wavelets/regress_daubechies_accuracy.cpp +++ b/example/daubechies_wavelets/regress_daubechies_accuracy.cpp @@ -1,3 +1,10 @@ +// (C) Copyright Nick Thompson 2020. +// 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) +// + + #include #include #include @@ -7,6 +14,7 @@ #include #include #include +#include int main(int argc, char** argv) @@ -84,49 +92,49 @@ int main(int argc, char** argv) std::cout << std::fixed << std::setprecision(16); auto q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, matched_holder); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "Matched Holder : " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, linear); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "Linear : " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, quadratic_b_spline); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "Quadratic B-spline: " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, cubic_b_spline); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "Cubic B-spline : " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, quintic_b_spline); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "Quintic B-spline : " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, cubic_hermite); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "Cubic Hermite : " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, pchip); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "PCHIP : " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, makima); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "Makima : " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, fotaylor); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "First-order Taylor: " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; if (sotaylor.size() > 0) { q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, quintic_hermite); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "Quintic Hermite : " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, sotaylor); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "2nd order Taylor : " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; } @@ -134,13 +142,13 @@ int main(int argc, char** argv) if (totaylor.size() > 0) { q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, totaylor); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "3rd order Taylor : " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; q = boost::math::statistics::simple_ordinary_least_squares_with_R_squared(r, septic_hermite); - assert(std::get<1>(q) < 0); + BOOST_ASSERT(std::get<1>(q) < 0); std::cout << "Septic Hermite : " << std::get<0>(q) << " - " << std::abs(std::get<1>(q)) << "r, R^2 = " << std::get<2>(q) << "\n"; } -} \ No newline at end of file +} diff --git a/example/reciprocal_fibonacci_constant.cpp b/example/reciprocal_fibonacci_constant.cpp index af71ed76c..349625fee 100644 --- a/example/reciprocal_fibonacci_constant.cpp +++ b/example/reciprocal_fibonacci_constant.cpp @@ -24,4 +24,4 @@ int main() { } std::cout << std::setprecision(1000) << "Reciprocal fibonacci constant after " << ITR << " iterations is: " << ans << std::endl; -} \ No newline at end of file +} diff --git a/example/to_continued_fraction.cpp b/example/to_continued_fraction.cpp index 7c7db7295..4eaa83050 100644 --- a/example/to_continued_fraction.cpp +++ b/example/to_continued_fraction.cpp @@ -2,6 +2,11 @@ // 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) +// +// Deliberately contains some unicode characters: +// +// boost-no-inspect +// #include #include #include