source: trunk/test/non_central_chi_squared_distribution.cc @ 3900

Last change on this file since 3900 was 3900, checked in by Peter, 3 years ago

closes #944; add configure check whether class is availabale in boost and exclude typedef if not. Lift out test for that typedef to separate test so it can be skipped (without skipping all sister tests) when boost is old.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
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
30using namespace theplu::yat;
31
32void continuous_function(random::Continuous& distribution)
33{
34}
35
36
37template<class RND, typename ResType>
38void 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
49template<class RND>
50void test_continuous(void)
51{
52  RND rnd;
53  continuous_function(rnd);
54  double result = 0.0;
55  test_base(rnd, result);
56}
57
58
59int 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}
Note: See TracBrowser for help on using the repository browser.