]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/math/test/test_expint_hooks.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / math / test / test_expint_hooks.hpp
CommitLineData
7c673cae
FG
1// (C) 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#ifndef BOOST_MATH_TEST_ZETA_OTHER_HOOKS_HPP
7#define BOOST_MATH_TEST_ZETA_OTHER_HOOKS_HPP
8
9
10#ifdef TEST_CEPHES
11namespace other{
12extern "C" {
13 double expn(int, double);
14 float expnf(int, float);
15 long double expnl(int, long double);
16}
17inline float expint(unsigned n, float a)
18{ return expnf(n, a); }
19inline double expint(unsigned n, double a)
20{ return expn(n, a); }
21inline long double expint(unsigned n, long double a)
22{
23#ifdef BOOST_MSVC
24 return expn(n, (double)a);
25#else
26 return expnl(n, a);
27#endif
28}
29// Ei is not supported:
30template <class T>
31inline T expint(T){ return 0; }
32}
33#define TEST_OTHER
34#endif
35
36#ifdef TEST_GSL
37#include <gsl/gsl_sf_expint.h>
38
39namespace other{
40inline float expint(float a)
41{ return (float)gsl_sf_expint_Ei(a); }
42inline double expint(double a)
43{ return gsl_sf_expint_Ei(a); }
44inline long double expint(long double a)
45{ return gsl_sf_expint_Ei(a); }
46// En is not supported:
47template <class T>
48inline T expint(unsigned, T){ return 0; }
49}
50#define TEST_OTHER
51#endif
52
53#ifdef TEST_SPECFUN
54namespace other{
55extern "C" int calcei_(double *arg, double *result, int*);
56inline float expint(float a)
57{
58 double r, a_(a);
59 int v = 1;
60 calcei_(&a_, &r, &v);
61 return (float)r;
62}
63inline double expint(double a)
64{
65 double r, a_(a);
66 int v = 1;
67 calcei_(&a_, &r, &v);
68 return r;
69}
70inline long double expint(long double a)
71{
72 double r, a_(a);
73 int v = 1;
74 calcei_(&a_, &r, &v);
75 return r;
76}
77// En is not supported:
78template <class T>
79inline T expint(unsigned, T){ return 0; }
80}
81#define TEST_OTHER
82#endif
83
84#ifdef TEST_OTHER
85namespace other{
86 boost::math::concepts::real_concept expint(unsigned, boost::math::concepts::real_concept){ return 0; }
87 boost::math::concepts::real_concept expint(boost::math::concepts::real_concept){ return 0; }
88}
89#endif
90
91
92#endif
93
94