File indexing completed on 2025-02-21 09:41:22
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_MATH_INTERPOLATORS_CARDINAL_QUINTIC_B_SPLINE_HPP
0008 #define BOOST_MATH_INTERPOLATORS_CARDINAL_QUINTIC_B_SPLINE_HPP
0009 #include <memory>
0010 #include <limits>
0011 #include <boost/math/interpolators/detail/cardinal_quintic_b_spline_detail.hpp>
0012
0013
0014 namespace boost{ namespace math{ namespace interpolators {
0015
0016 template <class Real>
0017 class cardinal_quintic_b_spline
0018 {
0019 public:
0020
0021
0022 cardinal_quintic_b_spline(const Real* const y,
0023 size_t n,
0024 Real t0 ,
0025 Real h ,
0026 std::pair<Real, Real> left_endpoint_derivatives = {std::numeric_limits<Real>::quiet_NaN(), std::numeric_limits<Real>::quiet_NaN()},
0027 std::pair<Real, Real> right_endpoint_derivatives = {std::numeric_limits<Real>::quiet_NaN(), std::numeric_limits<Real>::quiet_NaN()})
0028 : impl_(std::make_shared<detail::cardinal_quintic_b_spline_detail<Real>>(y, n, t0, h, left_endpoint_derivatives, right_endpoint_derivatives))
0029 {}
0030
0031
0032 cardinal_quintic_b_spline(std::vector<Real> const & y,
0033 Real t0 ,
0034 Real h ,
0035 std::pair<Real, Real> left_endpoint_derivatives = {std::numeric_limits<Real>::quiet_NaN(), std::numeric_limits<Real>::quiet_NaN()},
0036 std::pair<Real, Real> right_endpoint_derivatives = {std::numeric_limits<Real>::quiet_NaN(), std::numeric_limits<Real>::quiet_NaN()})
0037 : impl_(std::make_shared<detail::cardinal_quintic_b_spline_detail<Real>>(y.data(), y.size(), t0, h, left_endpoint_derivatives, right_endpoint_derivatives))
0038 {}
0039
0040
0041 Real operator()(Real t) const {
0042 return impl_->operator()(t);
0043 }
0044
0045 Real prime(Real t) const {
0046 return impl_->prime(t);
0047 }
0048
0049 Real double_prime(Real t) const {
0050 return impl_->double_prime(t);
0051 }
0052
0053 Real t_max() const {
0054 return impl_->t_max();
0055 }
0056
0057 private:
0058 std::shared_ptr<detail::cardinal_quintic_b_spline_detail<Real>> impl_;
0059 };
0060
0061 }}}
0062 #endif