• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //  (C) Copyright John Maddock 2008.
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 #ifndef BOOST_MATH_TEST_NCCS_OTHER_HOOKS_HPP
7 #define BOOST_MATH_TEST_NCCS_OTHER_HOOKS_HPP
8 
9 
10 #ifdef TEST_R
11 #define MATHLIB_STANDALONE
12 #include <rmath.h>
13 namespace other{
nccs_cdf(float df,float nc,float x)14 inline float nccs_cdf(float df, float nc, float x)
15 {
16    return (float)pnchisq(x, df, nc, 1, 0);
17 }
nccs_cdf(double df,double nc,double x)18 inline double nccs_cdf(double df, double nc, double x)
19 {
20    return pnchisq(x, df, nc, 1, 0);
21 }
nccs_cdf(long double df,long double nc,long double x)22 inline long double nccs_cdf(long double df, long double nc, long double x)
23 {
24    return pnchisq((double)x, (double)df, (double)nc, 1, 0);
25 }
26 }
27 #define TEST_OTHER
28 #endif
29 
30 #ifdef TEST_CDFLIB
31 #include <cdflib.h>
32 namespace other{
nccs_cdf(double df,double nc,double x)33 inline double nccs_cdf(double df, double nc, double x)
34 {
35    int kind(1), status(0);
36    double p, q, bound(0);
37    cdfchn(&kind, &p, &q, &x, &df, &nc, &status, &bound);
38    return p;
39 }
nccs_cdf(float df,float nc,float x)40 inline float nccs_cdf(float df, float nc, float x)
41 {
42    return (double)nccs_cdf((double)df, (double)nc, (double)x);
43 }
nccs_cdf(long double df,long double nc,long double x)44 inline long double nccs_cdf(long double df, long double nc, long double x)
45 {
46    return nccs_cdf((double)df, (double)nc, (double)x);
47 }
48 }
49 #define TEST_OTHER
50 #endif
51 
52 #ifdef TEST_OTHER
53 namespace other{
nccs_cdf(boost::math::concepts::real_concept,boost::math::concepts::real_concept,boost::math::concepts::real_concept)54    boost::math::concepts::real_concept nccs_cdf(boost::math::concepts::real_concept, boost::math::concepts::real_concept, boost::math::concepts::real_concept){ return 0; }
55 }
56 #endif
57 
58 
59 #endif
60 
61 
62