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