Remove use of deprecated boost headers.

This commit is contained in:
jzmaddock
2020-04-19 13:18:00 +01:00
parent fa924ab0ec
commit 264124b8d7
12 changed files with 62 additions and 18 deletions
+1 -1
View File
@@ -24,7 +24,7 @@
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp> // Boost.Test
#include <boost/test/floating_point_comparison.hpp>
#include <boost/test/tools/floating_point_comparison.hpp>
#include <iostream>
#include <iomanip>
+1 -1
View File
@@ -9,7 +9,7 @@
#include <boost/math/special_functions/gamma.hpp>
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <boost/test/tools/floating_point_comparison.hpp>
#include <boost/math/tools/stats.hpp>
#include <boost/math/tools/test.hpp>
#include <boost/math/constants/constants.hpp>
+1 -1
View File
@@ -13,7 +13,7 @@
//#include <boost/math/special_functions/expm1.hpp>
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <boost/test/tools/floating_point_comparison.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include "table_type.hpp"
+1 -1
View File
@@ -11,7 +11,7 @@
#include "setup.hpp"
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <boost/test/tools/floating_point_comparison.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include "table_type.hpp"
+2 -2
View File
@@ -16,7 +16,7 @@
#include <boost/multiprecision/debug_adaptor.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/timer.hpp>
#include "timer.hpp"
#include "test.hpp"
#include <iostream>
@@ -124,7 +124,7 @@ void test()
boost::random::mt19937 gen;
boost::uniform_int<> d(3, std::numeric_limits<T>::is_bounded ? std::numeric_limits<T>::digits : 3000);
boost::timer tim;
timer tim;
while (true)
{
+2 -2
View File
@@ -21,7 +21,7 @@
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/timer.hpp>
#include "timer.hpp"
#include "test.hpp"
#ifdef _MSC_VER
@@ -86,7 +86,7 @@ struct tester
typedef typename test_type::backend_type::checked_type checked;
unsigned last_error_count;
boost::timer tim;
timer tim;
boost::multiprecision::mpz_int a, b, c, d;
int si;
+3 -3
View File
@@ -21,7 +21,7 @@
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/timer.hpp>
#include "timer.hpp"
#include "test.hpp"
#ifdef _MSC_VER
@@ -81,7 +81,7 @@ typename boost::enable_if_c<boost::multiprecision::backends::is_fixed_precision<
static unsigned last_error_count = 0;
boost::timer tim;
timer tim;
do
{
@@ -190,7 +190,7 @@ typename boost::disable_if_c<boost::multiprecision::backends::is_fixed_precision
static unsigned last_error_count = 0;
boost::timer tim;
timer tim;
mpz_int mask;
if (std::numeric_limits<N>::is_bounded)
-1
View File
@@ -16,7 +16,6 @@
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/timer.hpp>
#include "test.hpp"
#if !defined(TEST1) && !defined(TEST2) && !defined(TEST3)
+2 -2
View File
@@ -14,7 +14,7 @@
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/timer.hpp>
#include "timer.hpp"
#include "test.hpp"
#include <iostream>
@@ -109,7 +109,7 @@ void test()
boost::random::mt19937 gen;
boost::uniform_int<> d(3, std::numeric_limits<T>::is_bounded ? std::numeric_limits<T>::digits : 3000);
boost::timer tim;
timer tim;
while (true)
{
+2 -2
View File
@@ -14,7 +14,7 @@
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/timer.hpp>
#include "timer.hpp"
#include "test.hpp"
#include <iostream>
@@ -124,7 +124,7 @@ void test()
boost::random::mt19937 gen;
boost::uniform_int<> d(3, std::numeric_limits<T>::is_bounded ? std::numeric_limits<T>::digits : 3000);
boost::timer tim;
timer tim;
while (true)
{
+2 -2
View File
@@ -5,7 +5,7 @@
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/timer.hpp>
#include "timer.hpp"
#include "test.hpp"
#include <iostream>
@@ -45,7 +45,7 @@ T generate_random(unsigned /*bits_wanted*/)
template <class T>
void test()
{
boost::timer tim;
timer tim;
while (true)
{
+45
View File
@@ -0,0 +1,45 @@
///////////////////////////////////////////////////////////////
// Copyright Beman Dawes 1994-99.
// Copyright 2020 John Maddock. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
#include <ctime>
#include <limits>
//
// This file archives the old (now deprecated) Boost.Timer.
// It is however, all that we need for a simple timeout.
//
// TODO: replace with std::chrono once we remove C++03
// support in 2021.
//
class timer
{
public:
timer() { _start_time = std::clock(); } // postcondition: elapsed()==0
// timer( const timer& src ); // post: elapsed()==src.elapsed()
// ~timer(){}
// timer& operator=( const timer& src ); // post: elapsed()==src.elapsed()
void restart() { _start_time = std::clock(); } // post: elapsed()==0
double elapsed() const // return elapsed time in seconds
{
return double(std::clock() - _start_time) / CLOCKS_PER_SEC;
}
double elapsed_max() const // return estimated maximum value for elapsed()
// Portability warning: elapsed_max() may return too high a value on systems
// where std::clock_t overflows or resets at surprising values.
{
return (double((std::numeric_limits<std::clock_t>::max)()) - double(_start_time)) / double(CLOCKS_PER_SEC);
}
double elapsed_min() const // return minimum value for elapsed()
{
return double(1) / double(CLOCKS_PER_SEC);
}
private:
std::clock_t _start_time;
}; // timer