25#ifndef quantlib_bicubic_spline_interpolation_hpp
26#define quantlib_bicubic_spline_interpolation_hpp
45 template <
class I1,
class I2,
class M>
51 const I2& yBegin,
const I2& yEnd,
69 std::vector<Real> section(
splines_.size());
78 return spline(
y,
true);
82 std::vector<Real> section(this->
zData_.columns());
83 for (
Size i=0; i < section.size(); ++i) {
96 std::vector<Real> section(this->
zData_.columns());
97 for (
Size i=0; i < section.size(); ++i) {
111 std::vector<Real> section(
splines_.size());
124 std::vector<Real> section(
splines_.size());
138 std::vector<Real> section(this->
zData_.columns());
139 for (
Size i=0; i < section.size(); ++i) {
166 template <
class I1,
class I2,
class M>
168 const I2& yBegin,
const I2& yEnd,
170 impl_ = ext::shared_ptr<Interpolation2D::Impl>(
172 yBegin, yEnd,
zData));
176 return ext::dynamic_pointer_cast<detail::BicubicSplineDerivatives>
177 (
impl_)->derivativeX(x,
y);
180 return ext::dynamic_pointer_cast<detail::BicubicSplineDerivatives>
181 (
impl_)->derivativeY(x,
y);
184 return ext::dynamic_pointer_cast<detail::BicubicSplineDerivatives>
185 (
impl_)->secondDerivativeX(x,
y);
188 return ext::dynamic_pointer_cast<detail::BicubicSplineDerivatives>
189 (
impl_)->secondDerivativeY(x,
y);
193 return ext::dynamic_pointer_cast<detail::BicubicSplineDerivatives>
194 (
impl_)->derivativeXY(x,
y);
201 template <
class I1,
class I2,
class M>
203 const I2& yBegin,
const I2& yEnd,
bicubic-spline-interpolation factory
Interpolation2D interpolate(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const I2 &yEnd, const M &z) const
bicubic-spline interpolation between discrete points
Real secondDerivativeX(Real x, Real y) const
Real secondDerivativeY(Real x, Real y) const
Real derivativeY(Real x, Real y) const
Real derivativeX(Real x, Real y) const
Real derivativeXY(Real x, Real y) const
BicubicSpline(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const I2 &yEnd, const M &zData)
Cubic interpolation between discrete points.
@ SecondDerivative
Match value of second derivative at end.
basic template implementation
const Matrix & zData() const override
templateImpl(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const I2 &yEnd, const M &zData)
base class for 2-D interpolations.
const Matrix & zData() const
ext::shared_ptr< Impl > impl_
Real secondDerivative(Real x, bool allowExtrapolation=false) const
Real derivative(Real x, bool allowExtrapolation=false) const
virtual Real derivativeX(Real x, Real y) const =0
virtual ~BicubicSplineDerivatives()=default
virtual Real derivativeXY(Real x, Real y) const =0
virtual Real secondDerivativeX(Real x, Real y) const =0
virtual Real secondDerivativeY(Real x, Real y) const =0
virtual Real derivativeY(Real x, Real y) const =0
std::vector< Interpolation > splines_
BicubicSplineImpl(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const I2 &yEnd, const M &zData)
Real secondDerivativeY(Real x, Real y) const override
Real derivativeX(Real x, Real y) const override
Real value(Real x, Real y) const override
void calculate() override
Real secondDerivativeX(Real x, Real y) const override
Real derivativeY(Real x, Real y) const override
Real derivativeXY(Real x, Real y) const override
cubic interpolation between discrete points
std::size_t Size
size of a container
abstract base classes for 2-D interpolations