24#ifndef quantlib_backward_flat_interpolation_hpp
25#define quantlib_backward_flat_interpolation_hpp
33 template<
class I1,
class I2>
class BackwardFlatInterpolationImpl;
44 template <
class I1,
class I2>
47 impl_ = ext::shared_ptr<Interpolation::Impl>(
new
58 template <
class I1,
class I2>
60 const I2& yBegin)
const {
69 template <
class I1,
class I2>
81 for (
Size i=1; i<
n; i++) {
82 Real dx = this->xBegin_[i]-this->xBegin_[i-1];
Backward-flat interpolation factory and traits.
static const Size requiredPoints
Interpolation interpolate(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin) const
Backward-flat interpolation between discrete points.
BackwardFlatInterpolation(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin)
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_
Real value(Real x) const override
Real derivative(Real) const override
Real secondDerivative(Real) const override
BackwardFlatInterpolationImpl(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin)
std::vector< Real > primitive_
Real primitive(Real x) const override
std::size_t Size
size of a container
base class for 1-D interpolations