QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
LaplaceInterpolation Class Reference

#include <laplaceinterpolation.hpp>

+ Collaboration diagram for LaplaceInterpolation:

Public Member Functions

 LaplaceInterpolation (std::function< Real(const std::vector< Size > &)> y, std::vector< std::vector< Real > > x, Real relTol=1E-6, Size maxIterMultiplier=10)
 
Real operator() (const std::vector< Size > &coordinates) const
 

Private Member Functions

std::vector< SizeprojectedCoordinates (const std::vector< Size > &coordinates) const
 
std::vector< SizefullCoordinates (const std::vector< Size > &projectedCoordinates) const
 

Private Attributes

std::function< Real(const std::vector< Size > &)> y_
 
std::vector< std::vector< Real > > x_
 
Real relTol_
 
Size maxIterMultiplier_
 
std::vector< boolcoordinateIncluded_
 
Size numberOfCoordinatesIncluded_
 
ext::shared_ptr< FdmLinearOpLayoutlayout_
 
Array interpolatedValues_
 

Detailed Description

Reconstruction of missing values using Laplace interpolation. We support an arbitrary number of dimensions n >= 1 and non-equidistant grids. For n = 1 the method is identical to linear interpolation with flat extrapolation. Reference: Numerical Recipes, 3rd edition, ch. 3.8.

Definition at line 42 of file laplaceinterpolation.hpp.

Constructor & Destructor Documentation

◆ LaplaceInterpolation()

LaplaceInterpolation ( std::function< Real(const std::vector< Size > &)>  y,
std::vector< std::vector< Real > >  x,
Real  relTol = 1E-6,
Size  maxIterMultiplier = 10 
)

Missing values y should be encoded as Null<Real>().

Definition at line 38 of file laplaceinterpolation.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

Real operator() ( const std::vector< Size > &  coordinates) const

Definition at line 200 of file laplaceinterpolation.cpp.

+ Here is the call graph for this function:

◆ projectedCoordinates()

std::vector< Size > projectedCoordinates ( const std::vector< Size > &  coordinates) const
private

Definition at line 181 of file laplaceinterpolation.cpp.

+ Here is the caller graph for this function:

◆ fullCoordinates()

std::vector< Size > fullCoordinates ( const std::vector< Size > &  projectedCoordinates) const
private

Definition at line 191 of file laplaceinterpolation.cpp.

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

Member Data Documentation

◆ y_

std::function<Real(const std::vector<Size>&)> y_
private

Definition at line 55 of file laplaceinterpolation.hpp.

◆ x_

std::vector<std::vector<Real> > x_
private

Definition at line 56 of file laplaceinterpolation.hpp.

◆ relTol_

Real relTol_
private

Definition at line 57 of file laplaceinterpolation.hpp.

◆ maxIterMultiplier_

Size maxIterMultiplier_
private

Definition at line 58 of file laplaceinterpolation.hpp.

◆ coordinateIncluded_

std::vector<bool> coordinateIncluded_
private

Definition at line 60 of file laplaceinterpolation.hpp.

◆ numberOfCoordinatesIncluded_

Size numberOfCoordinatesIncluded_
private

Definition at line 61 of file laplaceinterpolation.hpp.

◆ layout_

ext::shared_ptr<FdmLinearOpLayout> layout_
private

Definition at line 63 of file laplaceinterpolation.hpp.

◆ interpolatedValues_

Array interpolatedValues_
private

Definition at line 64 of file laplaceinterpolation.hpp.