]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Copyright John Maddock 2006. |
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 | // Basic sanity check that header <boost/math/distributions/find_location.hpp> | |
7 | // #includes all the files that it needs to. | |
8 | // | |
9 | #include <boost/math/distributions/find_location.hpp> | |
10 | // | |
11 | // Note this header includes no other headers, this is | |
12 | // important if this test is to be meaningful: | |
13 | // | |
14 | #include "test_compile_result.hpp" | |
15 | ||
16 | template <class T, class Policy = boost::math::policies::policy<> > | |
17 | class test_distribution | |
18 | { | |
19 | public: | |
20 | typedef T value_type; | |
21 | typedef Policy policy_type; | |
22 | test_distribution(){} | |
23 | }; | |
24 | ||
25 | template <class T, class Policy> | |
26 | T quantile(const test_distribution<T, Policy>&, T) | |
27 | { | |
28 | return 0; | |
29 | } | |
30 | ||
31 | template <class T, class Policy> | |
32 | T quantile(const boost::math::complemented2_type<test_distribution<T, Policy>, T>&) | |
33 | { | |
34 | return 0; | |
35 | } | |
36 | ||
37 | namespace boost{ namespace math{ namespace tools{ | |
38 | ||
39 | template <class T, class Policy> struct is_distribution<test_distribution<T, Policy> > : public mpl::true_{}; | |
40 | template <class T, class Policy> struct is_scaled_distribution<test_distribution<T, Policy> > : public mpl::true_{}; | |
41 | ||
42 | }}} | |
43 | ||
44 | void compile_and_link_test() | |
45 | { | |
46 | check_result<float>(boost::math::find_location<test_distribution<float> >(f, f, f, boost::math::policies::policy<>())); | |
47 | check_result<double>(boost::math::find_location<test_distribution<double> >(d, d, d, boost::math::policies::policy<>())); | |
48 | check_result<long double>(boost::math::find_location<test_distribution<long double> >(l, l, l, boost::math::policies::policy<>())); | |
49 | ||
50 | check_result<float>(boost::math::find_location<test_distribution<float> >(f, f, f)); | |
51 | check_result<double>(boost::math::find_location<test_distribution<double> >(d, d, d)); | |
52 | check_result<long double>(boost::math::find_location<test_distribution<long double> >(l, l, l)); | |
53 | ||
54 | check_result<float>(boost::math::find_location<test_distribution<float> >(boost::math::complement(f, f, f, boost::math::policies::policy<>()))); | |
55 | check_result<double>(boost::math::find_location<test_distribution<double> >(boost::math::complement(d, d, d, boost::math::policies::policy<>()))); | |
56 | check_result<long double>(boost::math::find_location<test_distribution<long double> >(boost::math::complement(l, l, l, boost::math::policies::policy<>()))); | |
57 | ||
58 | check_result<float>(boost::math::find_location<test_distribution<float> >(boost::math::complement(f, f, f))); | |
59 | check_result<double>(boost::math::find_location<test_distribution<double> >(boost::math::complement(d, d, d))); | |
60 | check_result<long double>(boost::math::find_location<test_distribution<long double> >(boost::math::complement(l, l, l))); | |
61 | } |