1#include "CLHEP/GenericFunctions/StepDoublingRKStepper.hh"
17 std::vector<double> & errors)
const {
18 const unsigned int nvar = (
unsigned int)s.
variable.size();
23 d1.time = s.
time + dt/2.0;
45 if (h<=0)
throw std::runtime_error (
"SimpleRKStepper: negative stepsize");
46 const unsigned int nvar = (
unsigned int)s.
variable.size();
49 std::vector<std::vector<double> >k(tableau.
nSteps());
50 for (
unsigned int i=0;i<tableau.
nSteps();i++) {
53 for (
unsigned int v=0;v<nvar;v++) arg[v]=s.
variable[v];
54 for (
unsigned int j=0;j<i;j++) {
55 for (
unsigned int v=0;v<nvar;v++) arg[v] += h*tableau.
A(i,j)*k[j][v];
57 for (
unsigned int v=0;v<nvar;v++) k[i][v]=(*data->
_diffEqn[v])(arg);
63 for (
unsigned int i=0;i<tableau.
nSteps();i++) {
64 for (
unsigned int v=0;v<nvar;v++) d.
firstDerivative[v] += tableau.
b(i)*k[i][v];
78 return tableau.
order();
unsigned int nSteps() const
double & A(unsigned int i, unsigned int j)
double & b(unsigned int i)
unsigned int order() const
std::vector< const AbsFunction * > _diffEqn
virtual void step(const RKIntegrator::RKData *data, const RKIntegrator::RKData::Data &sdata, RKIntegrator::RKData::Data &ddata, std::vector< double > &errors) const
virtual unsigned int order() const
void doStep(const RKIntegrator::RKData *data, const RKIntegrator::RKData::Data &s, RKIntegrator::RKData::Data &d) const
virtual StepDoublingRKStepper * clone() const
StepDoublingRKStepper(const ButcherTableau &tableau)
virtual ~StepDoublingRKStepper()
std::vector< double > firstDerivative
std::vector< double > variable