• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
11 namespace other{
12 extern "C" {
13    double expn(int, double);
14    float expnf(int, float);
15    long double expnl(int, long double);
16 }
expint(unsigned n,float a)17 inline float expint(unsigned n, float a)
18 { return expnf(n, a); }
expint(unsigned n,double a)19 inline double expint(unsigned n, double a)
20 { return expn(n, a); }
expint(unsigned n,long double a)21 inline 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:
30 template <class T>
expint(T)31 inline 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 
39 namespace other{
expint(float a)40 inline float expint(float a)
41 { return (float)gsl_sf_expint_Ei(a); }
expint(double a)42 inline double expint(double a)
43 { return gsl_sf_expint_Ei(a); }
expint(long double a)44 inline long double expint(long double a)
45 { return gsl_sf_expint_Ei(a); }
46 // En is not supported:
47 template <class T>
expint(unsigned,T)48 inline T expint(unsigned, T){ return 0; }
49 }
50 #define TEST_OTHER
51 #endif
52 
53 #ifdef TEST_SPECFUN
54 namespace other{
55 extern "C" int calcei_(double *arg, double *result, int*);
expint(float a)56 inline float expint(float a)
57 {
58    double r, a_(a);
59    int v = 1;
60    calcei_(&a_, &r, &v);
61    return (float)r;
62 }
expint(double a)63 inline double expint(double a)
64 {
65    double r, a_(a);
66    int v = 1;
67    calcei_(&a_, &r, &v);
68    return r;
69 }
expint(long double a)70 inline 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:
78 template <class T>
expint(unsigned,T)79 inline T expint(unsigned, T){ return 0; }
80 }
81 #define TEST_OTHER
82 #endif
83 
84 #ifdef TEST_OTHER
85 namespace other{
expint(unsigned,boost::math::concepts::real_concept)86    boost::math::concepts::real_concept expint(unsigned, boost::math::concepts::real_concept){ return 0; }
expint(boost::math::concepts::real_concept)87    boost::math::concepts::real_concept expint(boost::math::concepts::real_concept){ return 0; }
88 }
89 #endif
90 
91 
92 #endif
93 
94 
95