whittaker_shannon.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright Nick Thompson, 2019
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt
  5. // or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. #ifndef BOOST_MATH_INTERPOLATORS_WHITAKKER_SHANNON_HPP
  7. #define BOOST_MATH_INTERPOLATORS_WHITAKKER_SHANNON_HPP
  8. #include <memory>
  9. #include <boost/math/interpolators/detail/whittaker_shannon_detail.hpp>
  10. namespace boost { namespace math { namespace interpolators {
  11. template<class RandomAccessContainer>
  12. class whittaker_shannon {
  13. public:
  14. using Real = typename RandomAccessContainer::value_type;
  15. whittaker_shannon(RandomAccessContainer&& y, Real const & t0, Real const & h)
  16. : m_impl(std::make_shared<detail::whittaker_shannon_detail<RandomAccessContainer>>(std::move(y), t0, h))
  17. {}
  18. inline Real operator()(Real t) const
  19. {
  20. return m_impl->operator()(t);
  21. }
  22. inline Real prime(Real t) const
  23. {
  24. return m_impl->prime(t);
  25. }
  26. inline Real operator[](size_t i) const
  27. {
  28. return m_impl->operator[](i);
  29. }
  30. RandomAccessContainer&& return_data()
  31. {
  32. return m_impl->return_data();
  33. }
  34. private:
  35. std::shared_ptr<detail::whittaker_shannon_detail<RandomAccessContainer>> m_impl;
  36. };
  37. }}}
  38. #endif