1 | // $Id: non_central_chi_squared_distribution.cc 3900 2020-05-03 08:29:25Z peter $ |
---|
2 | |
---|
3 | /* |
---|
4 | Copyright (C) 2020 Peter Johansson |
---|
5 | |
---|
6 | This file is part of the yat library, http://dev.thep.lu.se/yat |
---|
7 | |
---|
8 | The yat library is free software; you can redistribute it and/or |
---|
9 | modify it under the terms of the GNU General Public License as |
---|
10 | published by the Free Software Foundation; either version 3 of the |
---|
11 | License, or (at your option) any later version. |
---|
12 | |
---|
13 | The yat library is distributed in the hope that it will be useful, |
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public License |
---|
19 | along with yat. If not, see <http://www.gnu.org/licenses/>. |
---|
20 | */ |
---|
21 | |
---|
22 | #include <config.h> |
---|
23 | |
---|
24 | #include "Suite.h" |
---|
25 | |
---|
26 | #include "yat/random/ContinuousDistribution.h" |
---|
27 | |
---|
28 | #include "yat/utility/config_public.h" |
---|
29 | |
---|
30 | using namespace theplu::yat; |
---|
31 | |
---|
32 | void continuous_function(random::Continuous& distribution) |
---|
33 | { |
---|
34 | } |
---|
35 | |
---|
36 | |
---|
37 | template<class RND, typename ResType> |
---|
38 | void test_base(RND& rnd, ResType res) |
---|
39 | { |
---|
40 | res = rnd(); |
---|
41 | typename RND::param_type p = rnd.param(); |
---|
42 | res = rnd(p); |
---|
43 | rnd.param(p); |
---|
44 | test::avoid_compiler_warning(res); |
---|
45 | |
---|
46 | } |
---|
47 | |
---|
48 | |
---|
49 | template<class RND> |
---|
50 | void test_continuous(void) |
---|
51 | { |
---|
52 | RND rnd; |
---|
53 | continuous_function(rnd); |
---|
54 | double result = 0.0; |
---|
55 | test_base(rnd, result); |
---|
56 | } |
---|
57 | |
---|
58 | |
---|
59 | int main(int argc, char* argv[]) |
---|
60 | { |
---|
61 | test::Suite suite(argc, argv); |
---|
62 | #ifdef YAT_HAVE_BOOST_RANDOM_NON_CENTRAL_CHI_SQUARED_DISTRIBUTION |
---|
63 | test_continuous<random::NonCentralChiSquared>(); |
---|
64 | #else |
---|
65 | return EXIT_SKIP; |
---|
66 | #endif |
---|
67 | return suite.return_value(); |
---|
68 | } |
---|