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

Numerical Differentiation on arbitrarily spaced grids. More...

#include <ql/methods/finitedifferences/operators/numericaldifferentiation.hpp>

+ Collaboration diagram for NumericalDifferentiation:

Public Types

enum  Scheme { Central , Backward , Forward }
 

Public Member Functions

 NumericalDifferentiation (ext::function< Real(Real)> f, Size orderOfDerivative, Array x_offsets)
 
 NumericalDifferentiation (ext::function< Real(Real)> f, Size orderOfDerivative, Real stepSize, Size steps, Scheme scheme)
 
Real operator() (Real x) const
 
const Arrayoffsets () const
 
const Arrayweights () const
 

Public Attributes

QL_DEPRECATED typedef Real argument_type
 
QL_DEPRECATED typedef Real result_type
 

Private Attributes

const Array offsets_
 
const Array w_
 
const ext::function< Real(Real)> f_
 

Detailed Description

Numerical Differentiation on arbitrarily spaced grids.

References:

B. Fornberg, 1988. Generation of Finite Difference Formulas on Arbitrarily Spaced Grids, http://amath.colorado.edu/faculty/fornberg/Docs/MathComp_88_FD_formulas.pdf

Definition at line 41 of file numericaldifferentiation.hpp.

Member Enumeration Documentation

◆ Scheme

enum Scheme
Enumerator
Central 
Backward 
Forward 

Definition at line 55 of file numericaldifferentiation.hpp.

Constructor & Destructor Documentation

◆ NumericalDifferentiation() [1/2]

NumericalDifferentiation ( ext::function< Real(Real)>  f,
Size  orderOfDerivative,
Array  x_offsets 
)

Definition at line 104 of file numericaldifferentiation.cpp.

◆ NumericalDifferentiation() [2/2]

NumericalDifferentiation ( ext::function< Real(Real)>  f,
Size  orderOfDerivative,
Real  stepSize,
Size  steps,
Scheme  scheme 
)

Definition at line 111 of file numericaldifferentiation.cpp.

Member Function Documentation

◆ operator()()

Real operator() ( Real  x) const

Definition at line 77 of file numericaldifferentiation.hpp.

+ Here is the call graph for this function:

◆ offsets()

const Array & offsets ( ) const

Definition at line 91 of file numericaldifferentiation.hpp.

◆ weights()

const Array & weights ( ) const

Definition at line 87 of file numericaldifferentiation.hpp.

+ 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 47 of file numericaldifferentiation.hpp.

◆ result_type

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

Definition at line 53 of file numericaldifferentiation.hpp.

◆ offsets_

const Array offsets_
private

Definition at line 72 of file numericaldifferentiation.hpp.

◆ w_

const Array w_
private

Definition at line 72 of file numericaldifferentiation.hpp.

◆ f_

const ext::function<Real(Real)> f_
private

Definition at line 73 of file numericaldifferentiation.hpp.