Class astep_base (o2scl)¶
-
template<class vec_y_t = boost::numeric::ublas::vector<double>, class vec_dydx_t = vec_y_t, class vec_yerr_t = vec_y_t, class func_t = ode_funct, class fp_t = double>
class astep_base¶ Adaptive stepper [abstract base].
The adaptive stepper routines are based on one or many applications of ordinary ODE steppers (implemented in ode_step). Each adaptive stepper (astep_gsl or astep_nonadapt) can be used with any of the ODE stepper classes (e.g. ode_rkck_gsl). By default, ode_rkck_gsl is used. To modify the ODE stepper which is used, use the member function set_step() documented below.
Subclassed by o2scl::astep_gsl< boost::numeric::ublas::vector< double >, boost::numeric::ublas::vector< double >, boost::numeric::ublas::vector< double >, ode_funct<>, double >, o2scl::astep_gsl< ubvector, ubvector, ubvector, ode_funct<>, double >, o2scl::astep_gsl< boost::numeric::ublas::vector< double >, boost::numeric::ublas::vector< double >, boost::numeric::ublas::vector< double >, ode_funct, double >, o2scl::astep_gsl< solve_grid_mat_row, solve_grid_mat_row, solve_grid_mat_row, ode_funct_solve_grid >, o2scl::astep_gsl< std::vector< double >, std::vector< double >, std::vector< double >, ode_funct2, double >, o2scl::astep_gsl< vector< double >, vector< double >, vector< double >, ode_funct >, o2scl::astep_boost< step_t, vec_y_t, vec_dydx_t, vec_yerr_t, func_t, fp_t >, o2scl::astep_gsl< vec_y_t, vec_dydx_t, vec_yerr_t, func_t, fp_t >, o2scl::astep_nonadapt< vec_y_t, vec_dydx_t, vec_yerr_t, func_t, fp_t >
Public Functions
-
inline astep_base()¶
-
inline virtual ~astep_base()¶
-
virtual int astep(fp_t &x, fp_t xlimit, fp_t &h, size_t n, vec_y_t &y, vec_dydx_t &dydx_out, vec_yerr_t &yerr, func_t &derivs) = 0¶
Make an adaptive integration step of the system
derivs.This attempts to take a step of size
hfrom the pointxof ann-dimensionalsystemderivsstarting withy. On exit,xandycontain the new values at the end of the step,hcontains the size of the step,dydx_outcontains the derivative at the end of the step, andyerrcontains the estimated error at the end of the step.
-
virtual int astep_derivs(fp_t &x, fp_t xlimit, fp_t &h, size_t n, vec_y_t &y, vec_dydx_t &dydx, vec_yerr_t &yerr, func_t &derivs) = 0¶
Make an adaptive integration step of the system
derivswith derivatives.This attempts to take a step of size
hfrom the pointxof ann-dimensionalsystemderivsstarting withyand given the initial derivativesdydx. On exit,x,yanddydxcontain the new values at the end of the step,hcontains the size of the step,dydxcontains the derivative at the end of the step, andyerrcontains the estimated error at the end of the step.
-
virtual int astep_full(fp_t x, fp_t xlimit, fp_t &x_out, fp_t &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) = 0¶
Make an adaptive integration step of the system
derivswith derivatives.This function performs an adaptive integration step with the
n-dimensionalsystemderivsand parameterpa. It Begins atxwith initial stepsizeh, ensuring that the step goes no farther thanxlimit. At the end of the step, the size of the step taken ishand the new value ofxis inx_out. Initially, the function values and derivatives should be specified inyanddydx. The function values, derivatives, and the error at the end of the step are given inyout,yerr, anddydx_out. Unlike inode_stepobjects, the objectsy,yout,dydx, anddydx_outmust all be distinct.
-
inline int set_step(ode_step<vec_y_t, vec_dydx_t, vec_yerr_t, func_t, fp_t> &step)¶
Set stepper.
This sets the stepper for use in the adaptive step routine. If no stepper is specified, then the default (def_step of type ode_rkck_gsl) is used.
Public Members
-
int verbose¶
Set output level.
-
ode_rkck_gsl<vec_y_t, vec_dydx_t, vec_yerr_t, func_t, fp_t> def_step¶
The default stepper.
Protected Attributes
-
ode_step<vec_y_t, vec_dydx_t, vec_yerr_t, func_t, fp_t> *stepp¶
Pointer to the stepper being used.
-
inline astep_base()¶