48 lines · plain
1// Copyright Nick Thompson, 20192// Use, modification and distribution are subject to the3// Boost Software License, Version 1.0.4// (See accompanying file LICENSE_1_0.txt5// or copy at http://www.boost.org/LICENSE_1_0.txt)6#ifndef BOOST_MATH_INTERPOLATORS_WHITAKKER_SHANNON_HPP7#define BOOST_MATH_INTERPOLATORS_WHITAKKER_SHANNON_HPP8#include <memory>9#include <boost/math/interpolators/detail/whittaker_shannon_detail.hpp>10 11namespace boost { namespace math { namespace interpolators {12 13template<class RandomAccessContainer>14class whittaker_shannon {15public:16 17 using Real = typename RandomAccessContainer::value_type;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 22 inline Real operator()(Real t) const23 {24 return m_impl->operator()(t);25 }26 27 inline Real prime(Real t) const28 {29 return m_impl->prime(t);30 }31 32 inline Real operator[](size_t i) const33 {34 return m_impl->operator[](i);35 }36 37 RandomAccessContainer&& return_data()38 {39 return m_impl->return_data();40 }41 42 43private:44 std::shared_ptr<detail::whittaker_shannon_detail<RandomAccessContainer>> m_impl;45};46}}}47#endif48