cardinal_trigonometric.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // (C) Copyright Nick Thompson 2019.
  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. #ifndef BOOST_MATH_INTERPOLATORS_CARDINAL_TRIGONOMETRIC_HPP
  6. #define BOOST_MATH_INTERPOLATORS_CARDINAL_TRIGONOMETRIC_HPP
  7. #include <memory>
  8. #include <boost/math/interpolators/detail/cardinal_trigonometric_detail.hpp>
  9. namespace boost { namespace math { namespace interpolators {
  10. template<class RandomAccessContainer>
  11. class cardinal_trigonometric
  12. {
  13. public:
  14. using Real = typename RandomAccessContainer::value_type;
  15. cardinal_trigonometric(RandomAccessContainer const & v, Real t0, Real h)
  16. {
  17. m_impl = std::make_shared<interpolators::detail::cardinal_trigonometric_detail<Real>>(v.data(), v.size(), t0, h);
  18. }
  19. Real operator()(Real t) const
  20. {
  21. return m_impl->operator()(t);
  22. }
  23. Real prime(Real t) const
  24. {
  25. return m_impl->prime(t);
  26. }
  27. Real double_prime(Real t) const
  28. {
  29. return m_impl->double_prime(t);
  30. }
  31. Real period() const
  32. {
  33. return m_impl->period();
  34. }
  35. Real integrate() const
  36. {
  37. return m_impl->integrate();
  38. }
  39. Real squared_l2() const
  40. {
  41. return m_impl->squared_l2();
  42. }
  43. private:
  44. std::shared_ptr<interpolators::detail::cardinal_trigonometric_detail<Real>> m_impl;
  45. };
  46. }}}
  47. #endif