]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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) | |
5 | ||
6 | // | |
7 | // This tests that cpp_dec_float_50 meets our | |
8 | // conceptual requirements when used with Boost.Math. | |
9 | // | |
10 | #ifdef _MSC_VER | |
92f5a8d4 TL |
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 | |
7c673cae FG |
17 | #endif |
18 | ||
92f5a8d4 | 19 | #include <boost/container_hash/hash.hpp> |
7c673cae FG |
20 | #include <libs/math/test/compile_test/poison.hpp> |
21 | ||
92f5a8d4 TL |
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) |
23 | #define TEST_MPF_50 | |
24 | #define TEST_BACKEND | |
25 | #define TEST_MPZ | |
26 | #define TEST_MPFR_50 | |
27 | #define TEST_MPFR_6 | |
28 | #define TEST_MPFR_15 | |
29 | #define TEST_MPFR_17 | |
30 | #define TEST_MPFR_30 | |
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 | |
7c673cae FG |
35 | |
36 | #ifdef _MSC_VER | |
37 | #pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!") | |
38 | #endif | |
39 | #ifdef __GNUC__ | |
40 | #pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!" | |
41 | #endif | |
42 | ||
43 | #endif | |
44 | ||
45 | #if defined(TEST_MPF_50) || defined(TEST_MPZ) | |
46 | #include <boost/multiprecision/gmp.hpp> | |
47 | #endif | |
48 | #ifdef TEST_BACKEND | |
49 | #include <boost/multiprecision/concepts/mp_number_archetypes.hpp> | |
50 | #endif | |
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> | |
53 | #endif | |
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> | |
56 | #endif | |
57 | #if defined(TEST_CPP_BIN_FLOAT) | |
58 | #include <boost/multiprecision/cpp_bin_float.hpp> | |
59 | #endif | |
60 | #ifdef TEST_LOGGED_ADAPTER | |
61 | #include <boost/multiprecision/logged_adaptor.hpp> | |
62 | #endif | |
63 | ||
64 | #include <boost/math/special_functions.hpp> | |
65 | ||
66 | template <class T> | |
67 | void test_extra(T) | |
68 | { | |
92f5a8d4 | 69 | T v1, v2, v3; |
7c673cae FG |
70 | int i; |
71 | boost::math::ibeta_inv(v1, v2, v3); | |
72 | boost::math::ibetac_inv(v1, v2, v3); | |
7c673cae FG |
73 | } |
74 | ||
75 | void foo() | |
76 | { | |
77 | #ifdef TEST_BACKEND | |
78 | test_extra(boost::multiprecision::concepts::mp_number_float_architype()); | |
79 | #endif | |
80 | #ifdef TEST_MPF_50 | |
81 | test_extra(boost::multiprecision::mpf_float_50()); | |
82 | #endif | |
83 | #ifdef TEST_MPFR_50 | |
84 | test_extra(boost::multiprecision::mpfr_float_50()); | |
85 | #endif | |
86 | #ifdef TEST_MPFR_6 | |
87 | test_extra(boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<6> >()); | |
88 | #endif | |
89 | #ifdef TEST_MPFR_15 | |
90 | test_extra(boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<15> >()); | |
91 | #endif | |
92 | #ifdef TEST_MPFR_17 | |
93 | test_extra(boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<17> >()); | |
94 | #endif | |
95 | #ifdef TEST_MPFR_30 | |
96 | test_extra(boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<30> >()); | |
97 | #endif | |
98 | #ifdef TEST_CPP_DEC_FLOAT | |
99 | test_extra(boost::multiprecision::cpp_dec_float_50()); | |
100 | #endif | |
101 | #ifdef TEST_CPP_BIN_FLOAT | |
102 | test_extra(boost::multiprecision::cpp_bin_float_50()); | |
103 | #endif | |
104 | #ifdef TEST_CPP_DEC_FLOAT_NO_ET | |
105 | test_extra(boost::multiprecision::number<boost::multiprecision::cpp_dec_float<100>, boost::multiprecision::et_off>()); | |
106 | #endif | |
107 | #ifdef TEST_LOGGED_ADAPTER | |
108 | typedef boost::multiprecision::number<boost::multiprecision::logged_adaptor<boost::multiprecision::cpp_dec_float<50> > > num_t; | |
109 | test_extra(num_t()); | |
110 | #endif | |
111 | } | |
112 | ||
113 | int main() | |
114 | { | |
115 | foo(); | |
116 | } |