test_bessel_hooks.hpp 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // (C) Copyright John Maddock 2007.
  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. #ifndef BOOST_MATH_TEST_ERF_OTHER_HOOKS_HPP
  6. #define BOOST_MATH_TEST_ERF_OTHER_HOOKS_HPP
  7. #ifdef TEST_CEPHES
  8. namespace other{
  9. extern "C" {
  10. double jv(double, double);
  11. float jvf(float, float);
  12. long double jvl(long double, long double);
  13. double yv(double, double);
  14. float yvf(float, float);
  15. long double yvl(long double, long double);
  16. }
  17. inline float cyl_bessel_j(float a, float x)
  18. { return jvf(a, x); }
  19. inline double cyl_bessel_j(double a, double x)
  20. { return jv(a, x); }
  21. inline long double cyl_bessel_j(long double a, long double x)
  22. {
  23. #ifdef BOOST_MSVC
  24. return jv((double)a, x);
  25. #else
  26. return jvl(a, x);
  27. #endif
  28. }
  29. inline float cyl_neumann(float a, float x)
  30. { return yvf(a, x); }
  31. inline double cyl_neumann(double a, double x)
  32. { return yv(a, x); }
  33. inline long double cyl_neumann(long double a, long double x)
  34. {
  35. #ifdef BOOST_MSVC
  36. return yv((double)a, x);
  37. #else
  38. return yvl(a, x);
  39. #endif
  40. }
  41. }
  42. #define TEST_OTHER
  43. #endif
  44. #ifdef TEST_GSL
  45. #include <gsl/gsl_sf_bessel.h>
  46. #include <gsl/gsl_errno.h>
  47. #include <gsl/gsl_message.h>
  48. namespace other{
  49. inline float cyl_bessel_j(float a, float x)
  50. { return (float)gsl_sf_bessel_Jnu(a, x); }
  51. inline double cyl_bessel_j(double a, double x)
  52. { return gsl_sf_bessel_Jnu(a, x); }
  53. inline long double cyl_bessel_j(long double a, long double x)
  54. { return gsl_sf_bessel_Jnu(a, x); }
  55. inline float cyl_bessel_i(float a, float x)
  56. { return (float)gsl_sf_bessel_Inu(a, x); }
  57. inline double cyl_bessel_i(double a, double x)
  58. { return gsl_sf_bessel_Inu(a, x); }
  59. inline long double cyl_bessel_i(long double a, long double x)
  60. { return gsl_sf_bessel_Inu(a, x); }
  61. inline float cyl_bessel_k(float a, float x)
  62. { return (float)gsl_sf_bessel_Knu(a, x); }
  63. inline double cyl_bessel_k(double a, double x)
  64. { return gsl_sf_bessel_Knu(a, x); }
  65. inline long double cyl_bessel_k(long double a, long double x)
  66. { return gsl_sf_bessel_Knu(a, x); }
  67. inline float cyl_neumann(float a, float x)
  68. { return (float)gsl_sf_bessel_Ynu(a, x); }
  69. inline double cyl_neumann(double a, double x)
  70. { return gsl_sf_bessel_Ynu(a, x); }
  71. inline long double cyl_neumann(long double a, long double x)
  72. { return gsl_sf_bessel_Ynu(a, x); }
  73. }
  74. #define TEST_OTHER
  75. #endif
  76. #ifdef TEST_OTHER
  77. namespace other{
  78. boost::math::concepts::real_concept cyl_bessel_j(boost::math::concepts::real_concept, boost::math::concepts::real_concept){ return 0; }
  79. boost::math::concepts::real_concept cyl_bessel_i(boost::math::concepts::real_concept, boost::math::concepts::real_concept){ return 0; }
  80. boost::math::concepts::real_concept cyl_bessel_k(boost::math::concepts::real_concept, boost::math::concepts::real_concept){ return 0; }
  81. boost::math::concepts::real_concept cyl_neumann(boost::math::concepts::real_concept, boost::math::concepts::real_concept){ return 0; }
  82. }
  83. #endif
  84. #endif