change support python version
[platform/upstream/boost.git] / libs / multiprecision / test / concepts / sf_concept_check_elliptic.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)
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
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
17 #endif
18
19 #include <boost/container_hash/hash.hpp>
20 #include <libs/math/test/compile_test/poison.hpp>
21
22 #if !defined(TEST_MPF_50) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) \
23    && !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR_50)\
24    && !defined(TEST_MPFR_6) && !defined(TEST_MPFR_15) && !defined(TEST_MPFR_17) \
25    && !defined(TEST_MPFR_30) && !defined(TEST_CPP_DEC_FLOAT_NO_ET) && !defined(TEST_LOGGED_ADAPTER)\
26    && !defined(TEST_CPP_BIN_FLOAT)
27 #  define TEST_MPF_50
28 #  define TEST_BACKEND
29 #  define TEST_MPZ
30 #  define TEST_MPFR_50
31 #  define TEST_MPFR_6
32 #  define TEST_MPFR_15
33 #  define TEST_MPFR_17
34 #  define TEST_MPFR_30
35 #  define TEST_CPP_DEC_FLOAT
36 #  define TEST_CPP_DEC_FLOAT_NO_ET
37 #  define TEST_LOGGED_ADAPTER
38 #  define TEST_CPP_BIN_FLOAT
39
40 #ifdef _MSC_VER
41 #pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
42 #endif
43 #ifdef __GNUC__
44 #pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!"
45 #endif
46
47 #endif
48
49 #if defined(TEST_MPF_50) || defined(TEST_MPZ)
50 #include <boost/multiprecision/gmp.hpp>
51 #endif
52 #ifdef TEST_BACKEND
53 #include <boost/multiprecision/concepts/mp_number_archetypes.hpp>
54 #endif
55 #if defined(TEST_CPP_DEC_FLOAT) || defined(TEST_CPP_DEC_FLOAT_NO_ET) || defined(TEST_LOGGED_ADAPTER)
56 #include <boost/multiprecision/cpp_dec_float.hpp>
57 #endif
58 #if defined(TEST_CPP_BIN_FLOAT)
59 #include <boost/multiprecision/cpp_bin_float.hpp>
60 #endif
61 #if defined(TEST_MPFR_50) || defined(TEST_MPFR_6) || defined(TEST_MPFR_15) || defined(TEST_MPFR_17) || defined(TEST_MPFR_30)
62 #include <boost/multiprecision/mpfr.hpp>
63 #endif
64 #ifdef TEST_LOGGED_ADAPTER
65 #include <boost/multiprecision/logged_adaptor.hpp>
66 #endif
67
68 #include <boost/math/special_functions.hpp>
69
70 template <class T>
71 void test_extra(T)
72 {
73    T v1, v2, v3;
74    boost::math::ellint_1(v1);
75    boost::math::ellint_1(v1, v2);
76    boost::math::ellint_2(v1);
77    boost::math::ellint_2(v1, v2);
78    boost::math::ellint_3(v1, v2);
79    boost::math::ellint_3(v1, v2, v3);
80    boost::math::ellint_rc(v1, v2);
81    boost::math::ellint_rd(v1, v2, v3);
82    boost::math::ellint_rf(v1, v2, v3);
83    boost::math::ellint_rj(v1, v2, v3, v1);
84    boost::math::jacobi_elliptic(v1, v2, &v1, &v2);
85    boost::math::jacobi_cd(v1, v2);
86    boost::math::jacobi_cn(v1, v2);
87    boost::math::jacobi_cs(v1, v2);
88    boost::math::jacobi_dc(v1, v2);
89    boost::math::jacobi_dn(v1, v2);
90    boost::math::jacobi_ds(v1, v2);
91    boost::math::jacobi_nc(v1, v2);
92    boost::math::jacobi_nd(v1, v2);
93    boost::math::jacobi_ns(v1, v2);
94    boost::math::jacobi_sc(v1, v2);
95    boost::math::jacobi_sd(v1, v2);
96    boost::math::jacobi_sn(v1, v2);
97 }
98
99 void foo()
100 {
101 #ifdef TEST_BACKEND
102    test_extra(boost::multiprecision::concepts::mp_number_float_architype());
103 #endif
104 #ifdef TEST_MPF_50
105    test_extra(boost::multiprecision::mpf_float_50());
106 #endif
107 #ifdef TEST_MPFR_50
108    test_extra(boost::multiprecision::mpfr_float_50());
109 #endif
110 #ifdef TEST_MPFR_6
111    test_extra(boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<6> >());
112 #endif
113 #ifdef TEST_MPFR_15
114    test_extra(boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<15> >());
115 #endif
116 #ifdef TEST_MPFR_17
117    test_extra(boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<17> >());
118 #endif
119 #ifdef TEST_MPFR_30
120    test_extra(boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<30> >());
121 #endif
122 #ifdef TEST_CPP_DEC_FLOAT
123    test_extra(boost::multiprecision::cpp_dec_float_50());
124 #endif
125 #ifdef TEST_CPP_BIN_FLOAT
126    test_extra(boost::multiprecision::cpp_bin_float_50());
127 #endif
128 #ifdef TEST_CPP_DEC_FLOAT_NO_ET
129    test_extra(boost::multiprecision::number<boost::multiprecision::cpp_dec_float<100>, boost::multiprecision::et_off>());
130 #endif
131 #ifdef TEST_LOGGED_ADAPTER
132    typedef boost::multiprecision::number<boost::multiprecision::logged_adaptor<boost::multiprecision::cpp_dec_float<50> > > num_t;
133    test_extra(num_t());
134 #endif
135 }
136
137 int main()
138 {
139    foo();
140 }