|
|
Go to the documentation of this file. 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);
80 void writeHistory(std::ostream& os,
double dt,
bool cubic =
false)
const;
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_
std::vector< double > buf_
void integrateCoordinate(const unsigned which)
virtual AbsODERHS * clone() const =0
void truncateCoordinate(unsigned which, double minValue, double maxValue)
double lastDeltaT() const
RK4(const AbsODERHS &rhs)
void step(double t, double dt, const double *x, unsigned lenX, double *coordIncrement) const override
const char * methodName() const override
std::vector< double > historyBuffer_
virtual const char * methodName() const =0
ConstantStepOdeSolver & operator=(const ConstantStepOdeSolver &r)
void writeHistory(std::ostream &os, double dt, bool cubic=false) const
double interpolateCoordinate(unsigned which, double t, bool cubic=false) const
void step(double t, double dt, const double *x, unsigned lenX, double *coordIncrement) const override
void setRHS(const AbsODERHS &rhs)
std::vector< double > buf_
unsigned lastRunLength() const
double getIntegrated(unsigned which, unsigned idx) const
double getPeakTime(unsigned which) const
void setHistory(double dt, const double *data, unsigned dim, unsigned runLen)
const char * methodName() const override
RK2(const AbsODERHS &rhs)
virtual void step(double t, double dt, const double *x, unsigned lenX, double *coordIncrement) const =0
const AbsODERHS * getRHS() const
void step(double t, double dt, const double *x, unsigned lenX, double *coordIncrement) const override
double getTime(const unsigned idx) const
const char * methodName() const override
void run(const double *initialConditions, unsigned lenConditions, double dt, unsigned nSteps)
void writeIntegrated(std::ostream &os, unsigned which, double dt, bool cubic=false) const
double getCoordinate(const unsigned which, const unsigned idx) const
virtual ~ConstantStepOdeSolver()
ConstantStepOdeSolver(const AbsODERHS &rhs)
char data[epos_bytes_allocation]
double interpolateIntegrated(unsigned which, double t, bool cubic=false) const
std::ostream & operator<<(std::ostream &os, const ConstantStepOdeSolver &s)
EulerOdeSolver(const AbsODERHS &rhs)
std::vector< double > chargeBuffer_