123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #ifndef BOOST_MATH_INTERPOLATORS_CARDINAL_CUBIC_B_SPLINE_HPP
- #define BOOST_MATH_INTERPOLATORS_CARDINAL_CUBIC_B_SPLINE_HPP
- #include <boost/math/interpolators/detail/cardinal_cubic_b_spline_detail.hpp>
- namespace boost{ namespace math{ namespace interpolators {
- template <class Real>
- class cardinal_cubic_b_spline
- {
- public:
-
-
- template <class BidiIterator>
- cardinal_cubic_b_spline(const BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size,
- Real left_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN(),
- Real right_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN());
- cardinal_cubic_b_spline(const Real* const f, size_t length, Real left_endpoint, Real step_size,
- Real left_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN(),
- Real right_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN());
- cardinal_cubic_b_spline() = default;
- Real operator()(Real x) const;
- Real prime(Real x) const;
- Real double_prime(Real x) const;
- private:
- std::shared_ptr<detail::cardinal_cubic_b_spline_imp<Real>> m_imp;
- };
- template<class Real>
- cardinal_cubic_b_spline<Real>::cardinal_cubic_b_spline(const Real* const f, size_t length, Real left_endpoint, Real step_size,
- Real left_endpoint_derivative, Real right_endpoint_derivative) : m_imp(std::make_shared<detail::cardinal_cubic_b_spline_imp<Real>>(f, f + length, left_endpoint, step_size, left_endpoint_derivative, right_endpoint_derivative))
- {
- }
- template <class Real>
- template <class BidiIterator>
- cardinal_cubic_b_spline<Real>::cardinal_cubic_b_spline(BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size,
- Real left_endpoint_derivative, Real right_endpoint_derivative) : m_imp(std::make_shared<detail::cardinal_cubic_b_spline_imp<Real>>(f, end_p, left_endpoint, step_size, left_endpoint_derivative, right_endpoint_derivative))
- {
- }
- template<class Real>
- Real cardinal_cubic_b_spline<Real>::operator()(Real x) const
- {
- return m_imp->operator()(x);
- }
- template<class Real>
- Real cardinal_cubic_b_spline<Real>::prime(Real x) const
- {
- return m_imp->prime(x);
- }
- template<class Real>
- Real cardinal_cubic_b_spline<Real>::double_prime(Real x) const
- {
- return m_imp->double_prime(x);
- }
- }}}
- #endif
|