File: test_beta_hooks.hpp

package info (click to toggle)
boost1.35 1.35.0-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 203,856 kB
  • ctags: 337,867
  • sloc: cpp: 938,683; xml: 56,847; ansic: 41,589; python: 18,999; sh: 11,566; makefile: 664; perl: 494; yacc: 456; asm: 353; csh: 6
file content (81 lines) | stat: -rw-r--r-- 2,246 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//  (C) Copyright John Maddock 2006.
//  Use, modification and distribution are subject to the
//  Boost Software License, Version 1.0. (See accompanying file
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef BOOST_MATH_TEST_BETA_OTHER_HOOKS_HPP
#define BOOST_MATH_TEST_BETA_OTHER_HOOKS_HPP

#ifdef TEST_CEPHES
namespace other{
extern "C" {
   double beta(double, double);
   float betaf(float, float);
   long double betal(long double, long double);

   double incbet(double, double, double);
   float incbetf(float, float, float);
   long double incbetl(long double, long double, long double);
}
inline float beta(float a, float b)
{ return betaf(a, b); }
inline long double beta(long double a, long double b)
{
#ifdef BOOST_MSVC
   return beta((double)a, (double)b); 
#else
   return betal(a, b); 
#endif
}
inline float ibeta(float a, float b, float x)
{ return incbetf(a, b, x); }
inline double ibeta(double a, double b, double x)
{ return incbet(a, b, x); }
inline long double ibeta(long double a, long double b, long double x)
{
#ifdef BOOST_MSVC
   return incbet((double)a, (double)b, (double)x); 
#else
   return incbetl(a, b); 
#endif
}
}
#define TEST_OTHER
#endif

#ifdef TEST_GSL
#include <gsl/gsl_sf_gamma.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_message.h>

namespace other{
inline float beta(float a, float b)
{ return (float)gsl_sf_beta(a, b); }
inline double beta(double a, double b)
{ return gsl_sf_beta(a, b); }
inline long double beta(long double a, long double b)
{ return gsl_sf_beta(a, b); }

inline float ibeta(float a, float b, float x)
{ return (float)gsl_sf_beta_inc(a, b, x); }
inline double ibeta(double a, double b, double x)
{ return gsl_sf_beta_inc(a, b, x); }
inline long double ibeta(long double a, long double b, long double x)
{
   return gsl_sf_beta_inc((double)a, (double)b, (double)x); 
}
}
#define TEST_OTHER
#endif

#ifdef TEST_OTHER
namespace other{
   boost::math::concepts::real_concept beta(boost::math::concepts::real_concept, boost::math::concepts::real_concept){ return 0; }
   boost::math::concepts::real_concept ibeta(boost::math::concepts::real_concept, boost::math::concepts::real_concept, boost::math::concepts::real_concept){ return 0; }
}
#endif


#endif