#include <RKOne4OrderStep.h>
Public Types | |
typedef T | Scalar |
typedef RKSmallVector< T, N > | Vector |
Public Member Functions | |
std::pair< Vector, T > | operator() (Scalar startPar, const Vector &startState, const RKDerivative< T, N > &deriv, const RKDistance< T, N > &dist, Scalar step) |
Definition at line 10 of file RKOne4OrderStep.h.
typedef T RKOne4OrderStep< T, N >::Scalar |
Definition at line 14 of file RKOne4OrderStep.h.
typedef RKSmallVector<T,N> RKOne4OrderStep< T, N >::Vector |
Definition at line 15 of file RKOne4OrderStep.h.
std::pair< Vector, T> RKOne4OrderStep< T, N >::operator() | ( | Scalar | startPar, |
const Vector & | startState, | ||
const RKDerivative< T, N > & | deriv, | ||
const RKDistance< T, N > & | dist, | ||
Scalar | step | ||
) | [inline] |
Definition at line 18 of file RKOne4OrderStep.h.
References abs, and diffTreeTool::diff.
{ const Scalar huge = 1.e5; // ad hoc protection against infinities, must be done better! const Scalar hugediff = 100.; RK4OneStepTempl<T,N> solver; Vector one( solver(startPar, startState, deriv, step)); if (std::abs(one[0])>huge || std::abs(one(1)>huge)) return std::pair<Vector, Scalar>(one,hugediff); Vector firstHalf( solver(startPar, startState, deriv, step/2)); Vector secondHalf(solver(startPar+step/2, firstHalf, deriv, step/2)); Scalar diff = dist(one, secondHalf, startPar+step); return std::pair<Vector, Scalar>(secondHalf,diff); } };