File indexing completed on 2025-10-31 08:43:50
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_CARDINAL_CUBIC_B_SPLINE_HPP
0023 #define BOOST_MATH_INTERPOLATORS_CARDINAL_CUBIC_B_SPLINE_HPP
0024 
0025 #include <boost/math/interpolators/detail/cardinal_cubic_b_spline_detail.hpp>
0026 
0027 namespace boost{ namespace math{ namespace interpolators {
0028 
0029 template <class Real>
0030 class cardinal_cubic_b_spline
0031 {
0032 public:
0033     
0034     
0035     template <class BidiIterator>
0036     cardinal_cubic_b_spline(const BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size,
0037                    Real left_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN(),
0038                    Real right_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN());
0039     cardinal_cubic_b_spline(const Real* const f, size_t length, 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 
0043     cardinal_cubic_b_spline() = default;
0044     Real operator()(Real x) const;
0045 
0046     Real prime(Real x) const;
0047 
0048     Real double_prime(Real x) const;
0049 
0050 private:
0051     std::shared_ptr<detail::cardinal_cubic_b_spline_imp<Real>> m_imp;
0052 };
0053 
0054 template<class Real>
0055 cardinal_cubic_b_spline<Real>::cardinal_cubic_b_spline(const Real* const f, size_t length, Real left_endpoint, Real step_size,
0056                                      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))
0057 {
0058 }
0059 
0060 template <class Real>
0061 template <class BidiIterator>
0062 cardinal_cubic_b_spline<Real>::cardinal_cubic_b_spline(BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size,
0063    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))
0064 {
0065 }
0066 
0067 template<class Real>
0068 Real cardinal_cubic_b_spline<Real>::operator()(Real x) const
0069 {
0070     return m_imp->operator()(x);
0071 }
0072 
0073 template<class Real>
0074 Real cardinal_cubic_b_spline<Real>::prime(Real x) const
0075 {
0076     return m_imp->prime(x);
0077 }
0078 
0079 template<class Real>
0080 Real cardinal_cubic_b_spline<Real>::double_prime(Real x) const
0081 {
0082     return m_imp->double_prime(x);
0083 }
0084 
0085 
0086 }}}
0087 #endif