QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Interpolation Class Reference

base class for 1-D interpolations. More...

#include <ql/math/interpolation.hpp>

+ Inheritance diagram for Interpolation:
+ Collaboration diagram for Interpolation:

Classes

class  Impl
 abstract base class for interpolation implementations More...
 
class  templateImpl
 basic template implementation More...
 

Public Member Functions

 Interpolation ()=default
 
 ~Interpolation () override=default
 
bool empty () const
 
Real operator() (Real x, bool allowExtrapolation=false) const
 
Real primitive (Real x, bool allowExtrapolation=false) const
 
Real derivative (Real x, bool allowExtrapolation=false) const
 
Real secondDerivative (Real x, bool allowExtrapolation=false) const
 
Real xMin () const
 
Real xMax () const
 
bool isInRange (Real x) const
 
void update ()
 
- Public Member Functions inherited from Extrapolator
 Extrapolator ()=default
 
virtual ~Extrapolator ()=default
 
void enableExtrapolation (bool b=true)
 enable extrapolation in subsequent calls More...
 
void disableExtrapolation (bool b=true)
 disable extrapolation in subsequent calls More...
 
bool allowsExtrapolation () const
 tells whether extrapolation is enabled More...
 

Public Attributes

QL_DEPRECATED typedef Real argument_type
 
QL_DEPRECATED typedef Real result_type
 

Protected Member Functions

void checkRange (Real x, bool extrapolate) const
 

Protected Attributes

ext::shared_ptr< Implimpl_
 

Detailed Description

base class for 1-D interpolations.

Classes derived from this class will provide interpolated values from two sequences of equal length, representing discretized values of a variable and a function of the former, respectively.

Warning:
Interpolations don't copy their underlying data; instead, they store iterators through which they access them. This allow them to see changes in the underlying data without having to propagate them manually, but adds the requirement that the lifetime of the underlying data exceeds or equals the lifetime of the interpolation. It is up to the user to ensure this: usually, a class will store as data members both the data and the interpolation (see, e.g., the InterpolatedCurve class) and call the update() method on the latter when the data change.

Definition at line 55 of file interpolation.hpp.

Constructor & Destructor Documentation

◆ Interpolation()

Interpolation ( )
default

◆ ~Interpolation()

~Interpolation ( )
overridedefault

Member Function Documentation

◆ empty()

bool empty ( ) const

Definition at line 132 of file interpolation.hpp.

◆ operator()()

Real operator() ( Real  x,
bool  allowExtrapolation = false 
) const

Definition at line 133 of file interpolation.hpp.

+ Here is the call graph for this function:

◆ primitive()

Real primitive ( Real  x,
bool  allowExtrapolation = false 
) const

Definition at line 137 of file interpolation.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ derivative()

Real derivative ( Real  x,
bool  allowExtrapolation = false 
) const

Definition at line 141 of file interpolation.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ secondDerivative()

Real secondDerivative ( Real  x,
bool  allowExtrapolation = false 
) const

Definition at line 145 of file interpolation.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xMin()

Real xMin ( ) const

Definition at line 149 of file interpolation.hpp.

◆ xMax()

Real xMax ( ) const

Definition at line 152 of file interpolation.hpp.

+ Here is the caller graph for this function:

◆ isInRange()

bool isInRange ( Real  x) const

Definition at line 155 of file interpolation.hpp.

◆ update()

void update ( )

Definition at line 158 of file interpolation.hpp.

+ Here is the caller graph for this function:

◆ checkRange()

void checkRange ( Real  x,
bool  extrapolate 
) const
protected

Definition at line 162 of file interpolation.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ argument_type

QL_DEPRECATED typedef Real argument_type
Deprecated:
Use auto or decltype instead. Deprecated in version 1.29.

Definition at line 78 of file interpolation.hpp.

◆ result_type

QL_DEPRECATED typedef Real result_type
Deprecated:
Use auto or decltype instead. Deprecated in version 1.29.

Definition at line 84 of file interpolation.hpp.

◆ impl_

ext::shared_ptr<Impl> impl_
protected

Definition at line 72 of file interpolation.hpp.