QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
#include <adaptiverungekutta.hpp>
Public Types | |
typedef ext::function< std::vector< T >(const Real, const std::vector< T > &)> | OdeFct |
typedef ext::function< T(const Real, const T)> | OdeFct1d |
Public Member Functions | |
AdaptiveRungeKutta (const Real eps=1.0e-6, const Real h1=1.0e-4, const Real hmin=0.0) | |
std::vector< T > | operator() (const OdeFct &ode, const std::vector< T > &y1, Real x1, Real x2) |
T | operator() (const OdeFct1d &ode, T y1, Real x1, Real x2) |
Private Member Functions | |
void | rkqs (std::vector< T > &y, const std::vector< T > &dydx, Real &x, Real htry, Real eps, const std::vector< Real > &yScale, Real &hdid, Real &hnext, const OdeFct &derivs) |
void | rkck (const std::vector< T > &y, const std::vector< T > &dydx, Real x, Real h, std::vector< T > &yout, std::vector< T > &yerr, const OdeFct &derivs) |
Private Attributes | |
const std::vector< T > | yStart_ |
const Real | eps_ |
const Real | h1_ |
const Real | hmin_ |
const Real | a2 = 0.2 |
const Real | a3 = 0.3 |
const Real | a4 = 0.6 |
const Real | a5 = 1.0 |
const Real | a6 = 0.875 |
const Real | b21 = 0.2 |
const Real | b31 |
const Real | b32 |
const Real | b41 = 0.3 |
const Real | b42 = -0.9 |
const Real | b43 = 1.2 |
const Real | b51 |
const Real | b52 = 2.5 |
const Real | b53 |
const Real | b54 |
const Real | b61 |
const Real | b62 |
const Real | b63 |
const Real | b64 |
const Real | b65 |
const Real | c1 |
const Real | c3 |
const Real | c4 |
const Real | c6 |
const Real | dc1 |
const Real | dc3 |
const Real | dc4 |
const Real | dc5 |
const Real | dc6 |
const double | ADAPTIVERK_MAXSTP = 10000 |
const double | ADAPTIVERK_TINY = 1.0E-30 |
const double | ADAPTIVERK_SAFETY = 0.9 |
const double | ADAPTIVERK_PGROW = -0.2 |
const double | ADAPTIVERK_PSHRINK = -0.25 |
const double | ADAPTIVERK_ERRCON = 1.89E-4 |
Definition at line 40 of file adaptiverungekutta.hpp.
Definition at line 42 of file adaptiverungekutta.hpp.
Definition at line 43 of file adaptiverungekutta.hpp.
AdaptiveRungeKutta | ( | const Real | eps = 1.0e-6 , |
const Real | h1 = 1.0e-4 , |
||
const Real | hmin = 0.0 |
||
) |
The class is constructed with the following inputs:
Definition at line 51 of file adaptiverungekutta.hpp.
Integrate the ode from \( x1 \) to \( x2 \) with initial value condition \( f(x1)=y1 \).
The ode is given by a function \( F: R \times K^n \rightarrow K^n \) as \( f'(x) = F(x,f(x)) \), $K=R, C$
Definition at line 99 of file adaptiverungekutta.hpp.
Definition at line 147 of file adaptiverungekutta.hpp.
|
private |
Definition at line 156 of file adaptiverungekutta.hpp.
|
private |
Definition at line 207 of file adaptiverungekutta.hpp.
|
private |
Definition at line 86 of file adaptiverungekutta.hpp.
|
private |
Definition at line 87 of file adaptiverungekutta.hpp.
|
private |
Definition at line 87 of file adaptiverungekutta.hpp.
|
private |
Definition at line 87 of file adaptiverungekutta.hpp.
|
private |
Definition at line 88 of file adaptiverungekutta.hpp.
|
private |
Definition at line 88 of file adaptiverungekutta.hpp.
|
private |
Definition at line 88 of file adaptiverungekutta.hpp.
|
private |
Definition at line 88 of file adaptiverungekutta.hpp.
|
private |
Definition at line 88 of file adaptiverungekutta.hpp.
|
private |
Definition at line 88 of file adaptiverungekutta.hpp.
|
private |
Definition at line 88 of file adaptiverungekutta.hpp.
|
private |
Definition at line 88 of file adaptiverungekutta.hpp.
|
private |
Definition at line 89 of file adaptiverungekutta.hpp.
|
private |
Definition at line 89 of file adaptiverungekutta.hpp.
|
private |
Definition at line 89 of file adaptiverungekutta.hpp.
|
private |
Definition at line 89 of file adaptiverungekutta.hpp.
|
private |
Definition at line 89 of file adaptiverungekutta.hpp.
|
private |
Definition at line 89 of file adaptiverungekutta.hpp.
|
private |
Definition at line 89 of file adaptiverungekutta.hpp.
|
private |
Definition at line 89 of file adaptiverungekutta.hpp.
|
private |
Definition at line 89 of file adaptiverungekutta.hpp.
|
private |
Definition at line 89 of file adaptiverungekutta.hpp.
|
private |
Definition at line 89 of file adaptiverungekutta.hpp.
|
private |
Definition at line 90 of file adaptiverungekutta.hpp.
|
private |
Definition at line 90 of file adaptiverungekutta.hpp.
|
private |
Definition at line 90 of file adaptiverungekutta.hpp.
|
private |
Definition at line 90 of file adaptiverungekutta.hpp.
|
private |
Definition at line 90 of file adaptiverungekutta.hpp.
|
private |
Definition at line 90 of file adaptiverungekutta.hpp.
|
private |
Definition at line 90 of file adaptiverungekutta.hpp.
|
private |
Definition at line 90 of file adaptiverungekutta.hpp.
|
private |
Definition at line 90 of file adaptiverungekutta.hpp.
|
private |
Definition at line 90 of file adaptiverungekutta.hpp.
|
private |
Definition at line 91 of file adaptiverungekutta.hpp.
|
private |
Definition at line 91 of file adaptiverungekutta.hpp.
|
private |
Definition at line 91 of file adaptiverungekutta.hpp.
|
private |
Definition at line 92 of file adaptiverungekutta.hpp.
|
private |
Definition at line 92 of file adaptiverungekutta.hpp.
|
private |
Definition at line 93 of file adaptiverungekutta.hpp.