21#ifndef quantlib_kernel_interpolation_hpp
22#define quantlib_kernel_interpolation_hpp
36 template <
class I1,
class I2,
class Kernel>
63 QL_FAIL(
"Primitive calculation not implemented "
64 "for kernel interpolation");
68 QL_FAIL(
"First derivative calculation not implemented "
69 "for kernel interpolation");
73 QL_FAIL(
"Second derivative calculation not implemented "
74 "for kernel interpolation");
80 return kernel_(std::fabs(x1-x2));
119 for (
Real i : diffVec) {
158 template <
class I1,
class I2,
class Kernel>
161 const Kernel& kernel,
162 const double epsilon = 1.0E-7) {
163 impl_ = ext::shared_ptr<Interpolation::Impl>(
new
1-D array used in linear algebra.
basic template implementation
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_
Kernel interpolation between discrete points.
KernelInterpolation(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const Kernel &kernel, const double epsilon=1.0E-7)
Matrix used in linear algebra.
Real value(Real x) const override
Real derivative(Real) const override
Real secondDerivative(Real) const override
Real primitive(Real) const override
Real gammaFunc(Real x) const
KernelInterpolationImpl(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, Kernel kernel, const Real epsilon)
Real kernelAbs(Real x1, Real x2) const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
std::size_t Size
size of a container
base class for 1-D interpolations
Array qrSolve(const Matrix &a, const Array &b, bool pivot, const Array &d)
QR Solve.
Array Abs(const Array &v)