24 #ifndef O2SCL_ASTEP_NONADAPT_H 25 #define O2SCL_ASTEP_NONADAPT_H 31 #include <gsl/gsl_math.h> 32 #include <gsl/gsl_odeiv.h> 34 #include <boost/numeric/ublas/vector.hpp> 36 #include <o2scl/astep.h> 38 #ifndef DOXYGEN_NO_O2NS 53 template<
class vec_y_t=boost::numeric::ublas::vector<
double>,
54 class vec_dydx_t=vec_y_t,
class vec_yerr_t=vec_y_t,
56 public astep_base<vec_y_t,vec_dydx_t,vec_yerr_t,func_t> {
58 #ifndef DOXYGEN_INTERNAL 103 virtual int astep(
double &x,
double xlimit,
double &h,
104 size_t n, vec_y_t &y, vec_dydx_t &dydx_out,
105 vec_yerr_t &yerr, func_t &derivs) {
111 derivs(x,n,y,dydx_int);
113 if (x+h>xlimit) h=xlimit-x;
115 if (x+h<xlimit) h=xlimit-x;
117 int ret=this->
stepp->step(x,h,n,y,dydx_int,y,yerr,dydx_out,derivs);
140 size_t n, vec_y_t &y, vec_dydx_t &dydx,
141 vec_yerr_t &yerr, func_t &derivs) {
144 if (x+h>xlimit) h=xlimit-x;
146 if (x+h<xlimit) h=xlimit-x;
148 int ret=this->
stepp->step(x,h,n,y,dydx,y,yerr,dydx,derivs);
174 virtual int astep_full(
double x,
double xlimit,
double &x_out,
double &h,
175 size_t n, vec_y_t &y, vec_dydx_t &dydx,
176 vec_y_t &yout, vec_yerr_t &yerr,
177 vec_dydx_t &dydx_out, func_t &derivs) {
180 if (x+h>xlimit) h=xlimit-x;
182 if (x+h<xlimit) h=xlimit-x;
184 int ret=this->
stepp->step(x,h,n,y,dydx,yout,yerr,dydx_out,derivs);
192 #ifndef DOXYGEN_NO_O2NS An non-adaptive stepper implementation of astep_base.
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
ode_step< vec_y_t, vec_dydx_t, vec_yerr_t, func_t > * stepp
Pointer to the stepper being used.
virtual int astep(double &x, double xlimit, double &h, size_t n, vec_y_t &y, vec_dydx_t &dydx_out, vec_yerr_t &yerr, func_t &derivs)
Make an adaptive integration step of the system derivs.
Adaptive stepper [abstract base].
vec_dydx_t dydx_int
Internal storage for dydx.
virtual int astep_full(double x, double xlimit, double &x_out, double &h, size_t n, vec_y_t &y, vec_dydx_t &dydx, vec_y_t &yout, vec_yerr_t &yerr, vec_dydx_t &dydx_out, func_t &derivs)
Make an adaptive integration step of the system derivs.
virtual int astep_derivs(double &x, double xlimit, double &h, size_t n, vec_y_t &y, vec_dydx_t &dydx, vec_yerr_t &yerr, func_t &derivs)
Make an adaptive integration step of the system derivs with derivatives.
size_t msize
The allocated vector size.