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
PolynomialFunction Class Reference

Cubic functional form More...

#include <polynomialmathfunction.hpp>

+ Collaboration diagram for PolynomialFunction:

Public Member Functions

 PolynomialFunction (const std::vector< Real > &coeff)
 
Real operator() (Time t) const
 function value at time t: More...
 
Real derivative (Time t) const
 
Real primitive (Time t) const
 
Real definiteIntegral (Time t1, Time t2) const
 
Size order () const
 
const std::vector< Real > & coefficients ()
 
const std::vector< Real > & derivativeCoefficients ()
 
const std::vector< Real > & primitiveCoefficients ()
 
std::vector< RealdefiniteIntegralCoefficients (Time t, Time t2) const
 
std::vector< RealdefiniteDerivativeCoefficients (Time t, Time t2) const
 

Private Member Functions

void initializeEqs_ (Time t, Time t2) const
 

Private Attributes

Size order_
 
std::vector< Realc_
 
std::vector< RealderC_
 
std::vector< RealprC_
 
Real K_
 
Matrix eqs_
 

Detailed Description

Cubic functional form

\[ f(t) = \sum_{i=0}^n{c_i t^i} \]

Definition at line 32 of file polynomialmathfunction.hpp.

Constructor & Destructor Documentation

◆ PolynomialFunction()

PolynomialFunction ( const std::vector< Real > &  coeff)

Definition at line 26 of file polynomialmathfunction.cpp.

Member Function Documentation

◆ operator()()

Real operator() ( Time  t) const

function value at time t:

\[ f(t) = \sum_{i=0}^n{c_i t^i} \]

Definition at line 44 of file polynomialmathfunction.cpp.

◆ derivative()

Real derivative ( Time  t) const

first derivative of the function at time t

\[ f'(t) = \sum_{i=0}^{n-1}{(i+1) c_{i+1} t^i} \]

Definition at line 53 of file polynomialmathfunction.cpp.

◆ primitive()

Real primitive ( Time  t) const

indefinite integral of the function at time t

\[ \int f(t)dt = \sum_{i=0}^n{c_i t^{i+1} / (i+1)} + K \]

Definition at line 62 of file polynomialmathfunction.cpp.

+ Here is the caller graph for this function:

◆ definiteIntegral()

Real definiteIntegral ( Time  t1,
Time  t2 
) const

definite integral of the function between t1 and t2

\[ \int_{t1}^{t2} f(t)dt \]

Definition at line 71 of file polynomialmathfunction.cpp.

+ Here is the call graph for this function:

◆ order()

Size order ( ) const

Inspectors

Definition at line 54 of file polynomialmathfunction.hpp.

◆ coefficients()

const std::vector< Real > & coefficients ( )

Definition at line 55 of file polynomialmathfunction.hpp.

◆ derivativeCoefficients()

const std::vector< Real > & derivativeCoefficients ( )

Definition at line 56 of file polynomialmathfunction.hpp.

◆ primitiveCoefficients()

const std::vector< Real > & primitiveCoefficients ( )

Definition at line 57 of file polynomialmathfunction.hpp.

◆ definiteIntegralCoefficients()

std::vector< Real > definiteIntegralCoefficients ( Time  t,
Time  t2 
) const

coefficients of a PolynomialFunction defined as definite integral on a rolling window of length tau, with tau = t2-t

Definition at line 90 of file polynomialmathfunction.cpp.

+ Here is the call graph for this function:

◆ definiteDerivativeCoefficients()

std::vector< Real > definiteDerivativeCoefficients ( Time  t,
Time  t2 
) const

coefficients of a PolynomialFunction defined as definite derivative on a rolling window of length tau, with tau = t2-t

Definition at line 100 of file polynomialmathfunction.cpp.

+ Here is the call graph for this function:

◆ initializeEqs_()

void initializeEqs_ ( Time  t,
Time  t2 
) const
private

Definition at line 76 of file polynomialmathfunction.cpp.

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

Member Data Documentation

◆ order_

Size order_
private

Definition at line 70 of file polynomialmathfunction.hpp.

◆ c_

std::vector<Real> c_
private

Definition at line 71 of file polynomialmathfunction.hpp.

◆ derC_

std::vector<Real> derC_
private

Definition at line 71 of file polynomialmathfunction.hpp.

◆ prC_

std::vector<Real> prC_
private

Definition at line 71 of file polynomialmathfunction.hpp.

◆ K_

Real K_
private

Definition at line 72 of file polynomialmathfunction.hpp.

◆ eqs_

Matrix eqs_
mutableprivate

Definition at line 73 of file polynomialmathfunction.hpp.