File: sf_performance_basic.cpp

package info (click to toggle)
boost1.62 1.62.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 686,420 kB
  • sloc: cpp: 2,609,004; xml: 972,558; ansic: 53,674; python: 32,437; sh: 8,829; asm: 3,071; cs: 2,121; makefile: 964; perl: 859; yacc: 472; php: 132; ruby: 94; f90: 55; sql: 13; csh: 6
file content (49 lines) | stat: -rw-r--r-- 2,091 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
///////////////////////////////////////////////////////////////
//  Copyright 2011 John Maddock. 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_

#include "sf_performance.hpp"

void basic_tests()
{

   std::cout << "Allocation Counts for Horner Evaluation:\n";
#ifdef TEST_MPFR
   basic_allocation_test("mpfr_float_50", mpfr_float_50(2));
   basic_allocation_test("mpfr_float_50 - no expression templates", number<mpfr_float_backend<50>, et_off>(2));
#endif
#ifdef TEST_MPFR_CLASS
   basic_allocation_test("mpfr_class", mpfr_class(2));
#endif
#ifdef TEST_MPREAL
   basic_allocation_test("mpfr::mpreal", mpfr::mpreal(2));
#endif

   std::cout << "Allocation Counts for boost::math::tools::evaluate_polynomial:\n";
#ifdef TEST_MPFR
   poly_allocation_test("mpfr_float_50", mpfr_float_50(2));
   poly_allocation_test("mpfr_float_50 - no expression templates", number<mpfr_float_backend<50>, et_off>(2));
#endif
#ifdef TEST_MPFR_CLASS
   poly_allocation_test("mpfr_class", mpfr_class(2));
#endif
#ifdef TEST_MPREAL
   poly_allocation_test("mpfr::mpreal", mpfr::mpreal(2));
#endif

   //
   // Comparison for builtin floats:
   //
#ifdef TEST_FLOAT
   time_proc("Bessel Functions - double", test_bessel<double>);
   time_proc("Bessel Functions - real_concept", test_bessel<boost::math::concepts::real_concept>);
   time_proc("Bessel Functions - arithmetic_backend<double>", test_bessel<number<arithmetic_backend<double>, et_on> >);
   time_proc("Bessel Functions - arithmetic_backend<double> - no expression templates", test_bessel<number<arithmetic_backend<double>, et_off> >);

   time_proc("Non-central T - double", test_nct<double>);
   time_proc("Non-central T - real_concept", test_nct<boost::math::concepts::real_concept>);
   time_proc("Non-central T - arithmetic_backend<double>", test_nct<number<arithmetic_backend<double>, et_on> >);
   time_proc("Non-central T - arithmetic_backend<double> - no expression templates", test_nct<number<arithmetic_backend<double>, et_off> >);
#endif
}