tools_series_inc_test.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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/tools/series.hpp>
  7. // #includes all the files that it needs to.
  8. //
  9. #include <boost/math/tools/series.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. struct Functor
  16. {
  17. typedef double result_type;
  18. double operator()();
  19. };
  20. #define U double
  21. Functor func;
  22. boost::uintmax_t uim = 0;
  23. void compile_and_link_test()
  24. {
  25. check_result<Functor::result_type>(boost::math::tools::sum_series<Functor>(func, i));
  26. check_result<Functor::result_type>(boost::math::tools::sum_series<Functor>(func, i, uim));
  27. check_result<Functor::result_type>(boost::math::tools::sum_series<Functor, U>(func, i, d));
  28. check_result<Functor::result_type>(boost::math::tools::sum_series<Functor, U>(func, i, uim, d));
  29. check_result<Functor::result_type>(boost::math::tools::kahan_sum_series<Functor>(func, i));
  30. check_result<Functor::result_type>(boost::math::tools::kahan_sum_series<Functor>(func, i, uim));
  31. }