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