25#ifndef quantlib_linear_interpolation_hpp
26#define quantlib_linear_interpolation_hpp
34 template<
class I1,
class I2>
class LinearInterpolationImpl;
45 template <
class I1,
class I2>
48 impl_ = ext::shared_ptr<Interpolation::Impl>(
new
59 template <
class I1,
class I2>
61 const I2& yBegin)
const {
70 template <
class I1,
class I2>
85 + dx*(this->
yBegin_[i-1] +0.5*dx*
s_[i-1]);
basic template implementation
Size locate(Real x) const
templateImpl(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const int requiredPoints=2)
base class for 1-D interpolations.
ext::shared_ptr< Impl > impl_
Linear-interpolation factory and traits
static const Size requiredPoints
Interpolation interpolate(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin) const
Linear interpolation between discrete points
LinearInterpolation(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin)
LinearInterpolationImpl(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin)
Real value(Real x) const override
Real secondDerivative(Real) const override
Real derivative(Real x) const override
std::vector< Real > primitiveConst_
Real primitive(Real x) const override
std::size_t Size
size of a container
base class for 1-D interpolations