sf_gamma_incl_test.cpp 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // 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. // Basic sanity check that header <boost/math/special_functions/gamma.hpp>
  7. // #includes all the files that it needs to.
  8. //
  9. #include <boost/math/special_functions/gamma.hpp>
  10. //
  11. // Note this header includes no other headers, this is
  12. // important if this test is to be meaningful:
  13. //
  14. #include "test_compile_result.hpp"
  15. void compile_and_link_test()
  16. {
  17. check_result<float>(boost::math::tgamma<float>(f));
  18. check_result<double>(boost::math::tgamma<double>(d));
  19. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  20. check_result<long double>(boost::math::tgamma<long double>(l));
  21. #endif
  22. check_result<float>(boost::math::lgamma<float>(f));
  23. check_result<double>(boost::math::lgamma<double>(d));
  24. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  25. check_result<long double>(boost::math::lgamma<long double>(l));
  26. #endif
  27. check_result<float>(boost::math::gamma_p<float>(f, f));
  28. check_result<double>(boost::math::gamma_p<double>(d, d));
  29. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  30. check_result<long double>(boost::math::gamma_p<long double>(l, l));
  31. #endif
  32. check_result<float>(boost::math::gamma_q<float>(f, f));
  33. check_result<double>(boost::math::gamma_q<double>(d, d));
  34. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  35. check_result<long double>(boost::math::gamma_q<long double>(l, l));
  36. #endif
  37. check_result<float>(boost::math::gamma_p_inv<float>(f, f));
  38. check_result<double>(boost::math::gamma_p_inv<double>(d, d));
  39. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  40. check_result<long double>(boost::math::gamma_p_inv<long double>(l, l));
  41. #endif
  42. check_result<float>(boost::math::gamma_q_inv<float>(f, f));
  43. check_result<double>(boost::math::gamma_q_inv<double>(d, d));
  44. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  45. check_result<long double>(boost::math::gamma_q_inv<long double>(l, l));
  46. #endif
  47. check_result<float>(boost::math::gamma_p_inva<float>(f, f));
  48. check_result<double>(boost::math::gamma_p_inva<double>(d, d));
  49. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  50. check_result<long double>(boost::math::gamma_p_inva<long double>(l, l));
  51. #endif
  52. check_result<float>(boost::math::gamma_q_inva<float>(f, f));
  53. check_result<double>(boost::math::gamma_q_inva<double>(d, d));
  54. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  55. check_result<long double>(boost::math::gamma_q_inva<long double>(l, l));
  56. #endif
  57. check_result<float>(boost::math::gamma_p_derivative<float>(f, f));
  58. check_result<double>(boost::math::gamma_p_derivative<double>(d, d));
  59. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  60. check_result<long double>(boost::math::gamma_p_derivative<long double>(l, l));
  61. #endif
  62. check_result<float>(boost::math::tgamma_ratio<float>(f, f));
  63. check_result<double>(boost::math::tgamma_ratio<double>(d, d));
  64. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  65. check_result<long double>(boost::math::tgamma_ratio<long double>(l, l));
  66. #endif
  67. check_result<float>(boost::math::tgamma_delta_ratio<float>(f, f));
  68. check_result<double>(boost::math::tgamma_delta_ratio<double>(d, d));
  69. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  70. check_result<long double>(boost::math::tgamma_delta_ratio<long double>(l, l));
  71. #endif
  72. }