]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/multiprecision/performance/sf_performance_basic.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / multiprecision / performance / sf_performance_basic.cpp
1 ///////////////////////////////////////////////////////////////
2 // Copyright 2011 John Maddock. Distributed under the Boost
3 // Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
5
6 #include "sf_performance.hpp"
7
8 void basic_tests()
9 {
10
11 std::cout << "Allocation Counts for Horner Evaluation:\n";
12 #ifdef TEST_MPFR
13 basic_allocation_test("mpfr_float_50", mpfr_float_50(2));
14 basic_allocation_test("mpfr_float_50 - no expression templates", number<mpfr_float_backend<50>, et_off>(2));
15 #endif
16 #ifdef TEST_MPFR_CLASS
17 basic_allocation_test("mpfr_class", mpfr_class(2));
18 #endif
19 #ifdef TEST_MPREAL
20 basic_allocation_test("mpfr::mpreal", mpfr::mpreal(2));
21 #endif
22
23 std::cout << "Allocation Counts for boost::math::tools::evaluate_polynomial:\n";
24 #ifdef TEST_MPFR
25 poly_allocation_test("mpfr_float_50", mpfr_float_50(2));
26 poly_allocation_test("mpfr_float_50 - no expression templates", number<mpfr_float_backend<50>, et_off>(2));
27 #endif
28 #ifdef TEST_MPFR_CLASS
29 poly_allocation_test("mpfr_class", mpfr_class(2));
30 #endif
31 #ifdef TEST_MPREAL
32 poly_allocation_test("mpfr::mpreal", mpfr::mpreal(2));
33 #endif
34
35 //
36 // Comparison for builtin floats:
37 //
38 #ifdef TEST_FLOAT
39 time_proc("Bessel Functions - double", test_bessel<double>);
40 time_proc("Bessel Functions - real_concept", test_bessel<boost::math::concepts::real_concept>);
41 time_proc("Bessel Functions - arithmetic_backend<double>", test_bessel<number<arithmetic_backend<double>, et_on> >);
42 time_proc("Bessel Functions - arithmetic_backend<double> - no expression templates", test_bessel<number<arithmetic_backend<double>, et_off> >);
43
44 time_proc("Non-central T - double", test_nct<double>);
45 time_proc("Non-central T - real_concept", test_nct<boost::math::concepts::real_concept>);
46 time_proc("Non-central T - arithmetic_backend<double>", test_nct<number<arithmetic_backend<double>, et_on> >);
47 time_proc("Non-central T - arithmetic_backend<double> - no expression templates", test_nct<number<arithmetic_backend<double>, et_off> >);
48 #endif
49 }