]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/multiprecision/test/concepts/sf_concept_check_gamma.cpp
1 // Copyright John Maddock 2012.
2 // Use, modification and distribution are subject to the
3 // Boost Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // This tests that cpp_dec_float_50 meets our
8 // conceptual requirements when used with Boost.Math.
11 #define _SCL_SECURE_NO_WARNINGS
12 #pragma warning(disable : 4800)
13 #pragma warning(disable : 4512)
14 #pragma warning(disable : 4127)
15 #pragma warning(disable : 4512)
16 #pragma warning(disable : 4503) // decorated name length exceeded, name was truncated
19 #include <boost/container_hash/hash.hpp>
20 #include <libs/math/test/compile_test/poison.hpp>
22 #if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50) && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) && !defined(TEST_MPFR_30) && !defined(TEST_CPP_DEC_FLOAT_NO_ET) && !defined(TEST_LOGGED_ADAPTER) && !defined(TEST_CPP_BIN_FLOAT)
31 #define TEST_CPP_DEC_FLOAT
32 #define TEST_CPP_DEC_FLOAT_NO_ET
33 #define TEST_LOGGED_ADAPTER
34 #define TEST_CPP_BIN_FLOAT
37 #pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
40 #pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!"
45 #if defined(TEST_MPF_50) || defined(TEST_MPZ)
46 #include <boost/multiprecision/gmp.hpp>
49 #include <boost/multiprecision/concepts/mp_number_archetypes.hpp>
51 #if defined(TEST_CPP_DEC_FLOAT) || defined(TEST_CPP_DEC_FLOAT_NO_ET) || defined(TEST_LOGGED_ADAPTER)
52 #include <boost/multiprecision/cpp_dec_float.hpp>
54 #if defined(TEST_MPFR_50) || defined(TEST_MPFR_6) || defined(TEST_MPFR_15) || defined(TEST_MPFR_17) || defined(TEST_MPFR_30)
55 #include <boost/multiprecision/mpfr.hpp>
57 #if defined(TEST_CPP_BIN_FLOAT)
58 #include <boost/multiprecision/cpp_bin_float.hpp>
60 #ifdef TEST_LOGGED_ADAPTER
61 #include <boost/multiprecision/logged_adaptor.hpp>
64 #include <boost/math/special_functions.hpp>
71 boost::math::tgamma(v1
);
72 boost::math::tgamma1pm1(v1
);
73 boost::math::lgamma(v1
);
74 boost::math::lgamma(v1
, &i
);
75 boost::math::digamma(v1
);
76 boost::math::tgamma_ratio(v1
, v2
);
77 boost::math::tgamma_delta_ratio(v1
, v2
);
78 boost::math::factorial
<T
>(i
);
79 boost::math::unchecked_factorial
<T
>(i
);
80 i
= boost::math::max_factorial
<T
>::value
;
81 boost::math::double_factorial
<T
>(i
);
82 boost::math::rising_factorial(v1
, i
);
83 boost::math::falling_factorial(v1
, i
);
84 boost::math::gamma_p_derivative(v2
, v3
);
85 boost::math::tgamma(v1
, v2
);
86 boost::math::tgamma_lower(v1
, v2
);
87 boost::math::gamma_p(v1
, v2
);
88 boost::math::gamma_q(v1
, v2
);
89 boost::math::gamma_p_inv(v1
, v2
);
90 boost::math::gamma_q_inv(v1
, v2
);
91 boost::math::gamma_p_inva(v1
, v2
);
92 boost::math::gamma_q_inva(v1
, v2
);
94 boost::math::erfc(v1
);
95 boost::math::erf_inv(v1
);
96 boost::math::erfc_inv(v1
);
102 test_extra(boost::multiprecision::concepts::mp_number_float_architype());
105 test_extra(boost::multiprecision::mpf_float_50());
108 test_extra(boost::multiprecision::mpfr_float_50());
111 test_extra(boost::multiprecision::number
<boost::multiprecision::mpfr_float_backend
<6> >());
114 test_extra(boost::multiprecision::number
<boost::multiprecision::mpfr_float_backend
<15> >());
117 test_extra(boost::multiprecision::number
<boost::multiprecision::mpfr_float_backend
<17> >());
120 test_extra(boost::multiprecision::number
<boost::multiprecision::mpfr_float_backend
<30> >());
122 #ifdef TEST_CPP_DEC_FLOAT
123 test_extra(boost::multiprecision::cpp_dec_float_50());
125 #ifdef TEST_CPP_BIN_FLOAT
126 test_extra(boost::multiprecision::cpp_bin_float_50());
128 #ifdef TEST_CPP_DEC_FLOAT_NO_ET
129 test_extra(boost::multiprecision::number
<boost::multiprecision::cpp_dec_float
<100>, boost::multiprecision::et_off
>());
131 #ifdef TEST_LOGGED_ADAPTER
132 typedef boost::multiprecision::number
<boost::multiprecision::logged_adaptor
<boost::multiprecision::cpp_dec_float
<50> > > num_t
;