CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions
RK4OneStepTempl< T, N > Class Template Reference

#include <RK4OneStepTempl.h>

Public Types

typedef T Scalar
 
typedef RKSmallVector< T, NVector
 

Public Member Functions

Vector operator() (Scalar startPar, const Vector &startState, const RKDerivative< T, N > &deriv, Scalar step) const
 

Detailed Description

template<typename T, int N>
class RK4OneStepTempl< T, N >

Definition at line 9 of file RK4OneStepTempl.h.

Member Typedef Documentation

◆ Scalar

template<typename T, int N>
typedef T RK4OneStepTempl< T, N >::Scalar

Definition at line 11 of file RK4OneStepTempl.h.

◆ Vector

template<typename T, int N>
typedef RKSmallVector<T, N> RK4OneStepTempl< T, N >::Vector

Definition at line 12 of file RK4OneStepTempl.h.

Member Function Documentation

◆ operator()()

template<typename T, int N>
Vector RK4OneStepTempl< T, N >::operator() ( Scalar  startPar,
const Vector startState,
const RKDerivative< T, N > &  deriv,
Scalar  step 
) const
inline

Definition at line 14 of file RK4OneStepTempl.h.

References relval_steps::k2, and mps_fire::result.

14  {
15  // cout << "RK4OneStepTempl: starting from " << startPar << startState << endl;
16 
17  Vector k1 = step * deriv(startPar, startState);
18  Vector k2 = step * deriv(startPar + step / 2, startState + k1 / 2);
19  Vector k3 = step * deriv(startPar + step / 2, startState + k2 / 2);
20  Vector k4 = step * deriv(startPar + step, startState + k3);
21 
22  Vector result = startState + k1 / 6 + k2 / 3 + k3 / 3 + k4 / 6;
23 
24  // cout << "RK4OneStepTempl: result for step " << step << " is " << result << endl;
25 
26  return result;
27  }
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
step
Definition: StallMonitor.cc:83