File indexing completed on 2025-02-21 09:41:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef BOOST_MATH_INTERPOLATORS_CUBIC_B_SPLINE_HPP
0023 #define BOOST_MATH_INTERPOLATORS_CUBIC_B_SPLINE_HPP
0024
0025 #include <boost/math/interpolators/detail/cubic_b_spline_detail.hpp>
0026 #include <boost/math/tools/header_deprecated.hpp>
0027
0028 BOOST_MATH_HEADER_DEPRECATED("<boost/math/interpolators/cardinal_cubic_b_spline.hpp>");
0029
0030 namespace boost{ namespace math{
0031
0032 template <class Real>
0033 class cubic_b_spline
0034 {
0035 public:
0036
0037
0038 template <class BidiIterator>
0039 cubic_b_spline(const BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size,
0040 Real left_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN(),
0041 Real right_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN());
0042 cubic_b_spline(const Real* const f, size_t length, Real left_endpoint, Real step_size,
0043 Real left_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN(),
0044 Real right_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN());
0045
0046 cubic_b_spline() = default;
0047 Real operator()(Real x) const;
0048
0049 Real prime(Real x) const;
0050
0051 Real double_prime(Real x) const;
0052
0053 private:
0054 std::shared_ptr<detail::cubic_b_spline_imp<Real>> m_imp;
0055 };
0056
0057 template<class Real>
0058 cubic_b_spline<Real>::cubic_b_spline(const Real* const f, size_t length, Real left_endpoint, Real step_size,
0059 Real left_endpoint_derivative, Real right_endpoint_derivative) : m_imp(std::make_shared<detail::cubic_b_spline_imp<Real>>(f, f + length, left_endpoint, step_size, left_endpoint_derivative, right_endpoint_derivative))
0060 {
0061 }
0062
0063 template <class Real>
0064 template <class BidiIterator>
0065 cubic_b_spline<Real>::cubic_b_spline(BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size,
0066 Real left_endpoint_derivative, Real right_endpoint_derivative) : m_imp(std::make_shared<detail::cubic_b_spline_imp<Real>>(f, end_p, left_endpoint, step_size, left_endpoint_derivative, right_endpoint_derivative))
0067 {
0068 }
0069
0070 template<class Real>
0071 Real cubic_b_spline<Real>::operator()(Real x) const
0072 {
0073 return m_imp->operator()(x);
0074 }
0075
0076 template<class Real>
0077 Real cubic_b_spline<Real>::prime(Real x) const
0078 {
0079 return m_imp->prime(x);
0080 }
0081
0082 template<class Real>
0083 Real cubic_b_spline<Real>::double_prime(Real x) const
0084 {
0085 return m_imp->double_prime(x);
0086 }
0087
0088
0089 }}
0090 #endif