2 * Copyright Nick Thompson, 2020
3 * Use, modification and distribution are subject to the
4 * Boost Software License, Version 1.0. (See accompanying file
5 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_MATH_INTERPOLATORS_SEPTIC_HERMITE_HPP
8 #define BOOST_MATH_INTERPOLATORS_SEPTIC_HERMITE_HPP
12 #include <boost/math/interpolators/detail/septic_hermite_detail.hpp>
16 namespace interpolators {
18 template<class RandomAccessContainer>
22 using Real = typename RandomAccessContainer::value_type;
23 septic_hermite(RandomAccessContainer && x, RandomAccessContainer && y, RandomAccessContainer && dydx,
24 RandomAccessContainer && d2ydx2, RandomAccessContainer && d3ydx3)
25 : impl_(std::make_shared<detail::septic_hermite_detail<RandomAccessContainer>>(std::move(x),
26 std::move(y), std::move(dydx), std::move(d2ydx2), std::move(d3ydx3)))
29 inline Real operator()(Real x) const
31 return impl_->operator()(x);
34 inline Real prime(Real x) const
36 return impl_->prime(x);
39 inline Real double_prime(Real x) const
41 return impl_->double_prime(x);
44 friend std::ostream& operator<<(std::ostream & os, const septic_hermite & m)
52 return impl_->bytes() + sizeof(impl_);
55 std::pair<Real, Real> domain() const
57 return impl_->domain();
61 std::shared_ptr<detail::septic_hermite_detail<RandomAccessContainer>> impl_;
64 template<class RandomAccessContainer>
65 class cardinal_septic_hermite
68 using Real = typename RandomAccessContainer::value_type;
69 cardinal_septic_hermite(RandomAccessContainer && y, RandomAccessContainer && dydx,
70 RandomAccessContainer && d2ydx2, RandomAccessContainer && d3ydx3, Real x0, Real dx)
71 : impl_(std::make_shared<detail::cardinal_septic_hermite_detail<RandomAccessContainer>>(
72 std::move(y), std::move(dydx), std::move(d2ydx2), std::move(d3ydx3), x0, dx))
75 inline Real operator()(Real x) const
77 return impl_->operator()(x);
80 inline Real prime(Real x) const
82 return impl_->prime(x);
85 inline Real double_prime(Real x) const
87 return impl_->double_prime(x);
92 return impl_->bytes() + sizeof(impl_);
95 std::pair<Real, Real> domain() const
97 return impl_->domain();
101 std::shared_ptr<detail::cardinal_septic_hermite_detail<RandomAccessContainer>> impl_;
105 template<class RandomAccessContainer>
106 class cardinal_septic_hermite_aos {
108 using Point = typename RandomAccessContainer::value_type;
109 using Real = typename Point::value_type;
110 cardinal_septic_hermite_aos(RandomAccessContainer && data, Real x0, Real dx)
111 : impl_(std::make_shared<detail::cardinal_septic_hermite_detail_aos<RandomAccessContainer>>(std::move(data), x0, dx))
114 inline Real operator()(Real x) const
116 return impl_->operator()(x);
119 inline Real prime(Real x) const
121 return impl_->prime(x);
124 inline Real double_prime(Real x) const
126 return impl_->double_prime(x);
129 int64_t bytes() const
131 return impl_.size() + sizeof(impl_);
134 std::pair<Real, Real> domain() const
136 return impl_->domain();
140 std::shared_ptr<detail::cardinal_septic_hermite_detail_aos<RandomAccessContainer>> impl_;