#include <RK4OneStepTempl.h>
Public Types | |
typedef T | Scalar |
typedef RKSmallVector< T, N > | Vector |
Public Member Functions | |
Vector | operator() (Scalar startPar, const Vector &startState, const RKDerivative< T, N > &deriv, Scalar step) const |
Definition at line 8 of file RK4OneStepTempl.h.
typedef T RK4OneStepTempl< T, N >::Scalar |
Definition at line 11 of file RK4OneStepTempl.h.
typedef RKSmallVector<T,N> RK4OneStepTempl< T, N >::Vector |
Definition at line 12 of file RK4OneStepTempl.h.
Vector RK4OneStepTempl< T, N >::operator() | ( | Scalar | startPar, |
const Vector & | startState, | ||
const RKDerivative< T, N > & | deriv, | ||
Scalar | step | ||
) | const [inline] |
Definition at line 15 of file RK4OneStepTempl.h.
References query::result.
{ // cout << "RK4OneStepTempl: starting from " << startPar << startState << endl; Vector k1 = step * deriv( startPar, startState); Vector k2 = step * deriv( startPar+step/2, startState+k1/2); Vector k3 = step * deriv( startPar+step/2, startState+k2/2); Vector k4 = step * deriv( startPar+step, startState+k3); Vector result = startState + k1/6 + k2/3 + k3/3 + k4/6; // cout << "RK4OneStepTempl: result for step " << step << " is " << result << endl; return result; }