#include "utl/RK4ODEIntegrator.h"
Public Member Functions | |
template<class VectorType > | |
RK4Iterator< DerivativeFunctor, VectorType > | Begin (const double x, const VectorType &y) |
DerivativeFunctor & | GetDerivativeFunctor () |
RK4ODEIntegrator (DerivativeFunctor &d) | |
Private Attributes | |
DerivativeFunctor & | fDerivativeFunctor |
This class prepares the integration of the Ordinary Differential Equations (ODE) of the form
for .
ODE is defined through an function class with operator() defined (usualy such classes are called functor in C++). This functor has to define the operator() and unsigned int cast operator:
Operator() calculates derivatives of variables
with respect to the independent variable x.
The cast operator unsigned int() returns number of OD equations (in this example 10).
The class RK4ODEIntegrator returns an iterator that can be advanced with operator += dx for some step dx in independent variable.
Note that the suitable candidates for template parameter VectorType are vector classes with fixed size (std::vector<> is not appropriate since the default constructor leaves the object with zero size) that support the operator[] for element access. You can use the C-style arrays double[n] or Offline class utl::SVectorType<n>.
See also utl::RK5ODEIntegrator and testODEIntegrator.cc for a real examples.
Definition at line 161 of file RK4ODEIntegrator.h.
|
inline |
Definition at line 163 of file RK4ODEIntegrator.h.
|
inline |
Definition at line 168 of file RK4ODEIntegrator.h.
References utl::RK4ODEIntegrator< DerivativeFunctor >::fDerivativeFunctor.
Referenced by main(), TestODEIntegrator::TestRK4(), and TestODEIntegrator::TestRK4SVector().
|
inline |
Definition at line 174 of file RK4ODEIntegrator.h.
References utl::RK4ODEIntegrator< DerivativeFunctor >::fDerivativeFunctor.
|
private |
Definition at line 178 of file RK4ODEIntegrator.h.
Referenced by utl::RK4ODEIntegrator< DerivativeFunctor >::Begin(), and utl::RK4ODEIntegrator< DerivativeFunctor >::GetDerivativeFunctor().