• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 namespace boost { namespace math { namespace interpolators {
12 
13 template<class RandomAccessContainer>
14 class whittaker_shannon {
15 public:
16 
17     using Real = typename RandomAccessContainer::value_type;
whittaker_shannon(RandomAccessContainer && y,Real const & t0,Real const & h)18     whittaker_shannon(RandomAccessContainer&& y, Real const & t0, Real const & h)
19      : m_impl(std::make_shared<detail::whittaker_shannon_detail<RandomAccessContainer>>(std::move(y), t0, h))
20     {}
21 
operator ()(Real t) const22     inline Real operator()(Real t) const
23     {
24         return m_impl->operator()(t);
25     }
26 
prime(Real t) const27     inline Real prime(Real t) const
28     {
29         return m_impl->prime(t);
30     }
31 
operator [](size_t i) const32     inline Real operator[](size_t i) const
33     {
34         return m_impl->operator[](i);
35     }
36 
return_data()37     RandomAccessContainer&& return_data()
38     {
39         return m_impl->return_data();
40     }
41 
42 
43 private:
44     std::shared_ptr<detail::whittaker_shannon_detail<RandomAccessContainer>> m_impl;
45 };
46 }}}
47 #endif
48