// This may look like C code, but it is really -*- C++ -*-
#ifndef RK4CDIFEQ_H_SEEN
#define RK4CDIFEQ_H_SEEN
#include "difeq.h"
// Runge-Kutta ordre 4 adaptatif
// Runge-Kutta ordre 4 adaptatif, avec correction du pas d'integration
class RK4CDiffEq : public RK4DiffEq {
public:
// Constructeurs. Voir DiffEqSolver
//
RK4CDiffEq();
RK4CDiffEq(DiffEqFunction*);
RK4CDiffEq(DIFEQFCN1);
//
// Precision souhaitee, en absolu ou relatif, independamment pour chaque
// fonction ou globalement
//
RK4CDiffEq& Accuracy(double);
RK4CDiffEq& AbsAccuracy(OVector const& vScal);
RK4CDiffEq& AbsAccuracy(double scal);
RK4CDiffEq& RelAccuracy();
//
// Implementation RK4 adaptatif
virtual void SolveArr(OMatrix& y, double* t, double tf, int n);
protected:
// Un pas adaptatif
void RKCStep(OVector& newY, OVector const& y0, OVector const& yScale,
double dttry, double& dtdone, double& dtnext);
double eps;
bool relAccuracy;
OVector accScale;
OVector yTemp; // Pour ne pas reallouer
OVector ySave;
};
#endif