1 #ifndef CalibCalorimetry_HcalAlgos_ConstantStepOdeSolver_h_ 2 #define CalibCalorimetry_HcalAlgos_ConstantStepOdeSolver_h_ 45 throw cms::Exception(
"In ConstantStepOdeSolver::getTime: index out of range");
51 throw cms::Exception(
"In ConstantStepOdeSolver::getCoordinate: index out of range");
73 void run(
const double* initialConditions,
unsigned lenConditions,
double dt,
unsigned nSteps);
77 void setHistory(
double dt,
const double*
data,
unsigned dim,
unsigned runLen);
93 virtual void step(
double t,
double dt,
const double*
x,
unsigned lenX,
double* coordIncrement)
const = 0;
110 s.writeHistory(
os,
s.lastDeltaT());
121 inline const char*
methodName()
const override {
return "Euler"; }
124 void step(
double t,
double dt,
const double*
x,
unsigned lenX,
double* coordIncrement)
const override;
133 inline const char*
methodName()
const override {
return "2nd order Runge-Kutta"; }
136 void step(
double t,
double dt,
const double*
x,
unsigned lenX,
double* coordIncrement)
const override;
138 mutable std::vector<double>
buf_;
147 inline const char*
methodName()
const override {
return "4th order Runge-Kutta"; }
150 void step(
double t,
double dt,
const double*
x,
unsigned lenX,
double* coordIncrement)
const override;
152 mutable std::vector<double>
buf_;
155 #endif // CalibCalorimetry_HcalAlgos_ConstantStepOdeSolver_h_ virtual AbsODERHS * clone() const =0
RK4(const AbsODERHS &rhs)
const AbsODERHS * getRHS() const
double lastDeltaT() const
std::ostream & operator<<(std::ostream &os, const ConstantStepOdeSolver &s)
double getPeakTime(unsigned which) const
void step(double t, double dt, const double *x, unsigned lenX, double *coordIncrement) const override
double interpolateCoordinate(unsigned which, double t, bool cubic=false) const
ConstantStepOdeSolver(const AbsODERHS &rhs)
std::vector< double > chargeBuffer_
void step(double t, double dt, const double *x, unsigned lenX, double *coordIncrement) const override
double getCoordinate(const unsigned which, const unsigned idx) const
double interpolateIntegrated(unsigned which, double t, bool cubic=false) const
virtual void step(double t, double dt, const double *x, unsigned lenX, double *coordIncrement) const =0
std::vector< double > buf_
virtual const char * methodName() const =0
EulerOdeSolver(const AbsODERHS &rhs)
void step(double t, double dt, const double *x, unsigned lenX, double *coordIncrement) const override
void setRHS(const AbsODERHS &rhs)
void integrateCoordinate(const unsigned which)
unsigned lastRunLength() const
void writeHistory(std::ostream &os, double dt, bool cubic=false) const
ConstantStepOdeSolver & operator=(const ConstantStepOdeSolver &r)
std::vector< double > historyBuffer_
void writeIntegrated(std::ostream &os, unsigned which, double dt, bool cubic=false) const
void run(const double *initialConditions, unsigned lenConditions, double dt, unsigned nSteps)
virtual ~ConstantStepOdeSolver()
double getIntegrated(unsigned which, unsigned idx) const
const char * methodName() const override
char data[epos_bytes_allocation]
std::vector< double > buf_
void truncateCoordinate(unsigned which, double minValue, double maxValue)
const char * methodName() const override
void setHistory(double dt, const double *data, unsigned dim, unsigned runLen)
const char * methodName() const override
double getTime(const unsigned idx) const
RK2(const AbsODERHS &rhs)