Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QuadraticInterpolation Class Reference

Quadratic interpolation between discrete points More...

#include <qle/math/quadraticinterpolation.hpp>

+ Inheritance diagram for QuadraticInterpolation:
+ Collaboration diagram for QuadraticInterpolation:

Public Member Functions

template<class I1 , class I2 >
 QuadraticInterpolation (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, Real x_mul=1, Real x_offset=0, Real y_mul=1, Real y_offset=0, Size skip=0)
 
template<class I1 , class I2 >
std::vector< Real > lambdas () const
 

Detailed Description

Quadratic interpolation between discrete points

Warning:
See the Interpolation class for information about the required lifetime of the underlying data.

Definition at line 40 of file quadraticinterpolation.hpp.

Constructor & Destructor Documentation

◆ QuadraticInterpolation()

QuadraticInterpolation ( const I1 &  xBegin,
const I1 &  xEnd,
const I2 &  yBegin,
Real  x_mul = 1,
Real  x_offset = 0,
Real  y_mul = 1,
Real  y_offset = 0,
Size  skip = 0 
)
Precondition
the \( x \) values must be sorted.

Definition at line 44 of file quadraticinterpolation.hpp.

48 {
49 impl_ = ext::shared_ptr<Interpolation::Impl>(new
50 detail::QuadraticInterpolationImpl<I1,I2>(
51 xBegin + skip, xEnd, yBegin + skip,
52 x_mul, x_offset, y_mul, y_offset));
53 impl_->update();
54 }

Member Function Documentation

◆ lambdas()

std::vector< Real > lambdas ( ) const

Definition at line 56 of file quadraticinterpolation.hpp.

56 {
57 ext::shared_ptr<detail::QuadraticInterpolationImpl<I1,I2> > p =
58 ext::dynamic_pointer_cast<
59 detail::QuadraticInterpolationImpl<I1,I2> >(impl_);
60 QL_REQUIRE(p, "unable to cast impl to "
61 "QuadraticInterpolationImpl<I1,I2>");
62 return p->lambdas();
63 }