23 #ifndef O2SCL_ODE_IV_TABLE_H 24 #define O2SCL_ODE_IV_TABLE_H 30 #include <o2scl/astep.h> 31 #include <o2scl/astep_gsl.h> 32 #include <o2scl/ode_iv_solve.h> 34 #ifndef DOXYGEN_NO_O2NS 52 template<
class func_t=ode_funct<>,
53 class vec_t=ubvector,
class alloc_vec_t=ubvector,
61 std::string y_prefix, std::string dydx_prefix,
62 std::string yerr_prefix, func_t &derivs) {
66 double x0=t.
get(x_col,0);
67 double x1=t.
get(x_col,n_sol-1);
68 double h=t.
get(x_col,1)-x0;
72 this->ao.allocate(x_sol,n_sol);
73 ubmatrix ysol(n_sol,n), dydx_sol(n_sol,n), yerr_sol(n_sol,n);
80 this->
template solve_grid<ubmatrix,ubmatrix_row>
81 (x0,
x1,h,n,ystart,n_sol,x_sol,ysol,dydx_sol,yerr_sol,derivs);
84 std::vector<ubvector *> yt, dyt, errt;
87 for(
size_t i=0;i<n;i++) {
119 vec_t &ystart,
size_t &n_sol,
table<> &t,
120 std::string x_col, std::string y_prefix,
121 std::string dydx_prefix, std::string yerr_prefix,
129 this->ao.allocate(x_sol,n_sol);
130 ubmatrix ysol(n_sol,n), dydx_sol(n_sol,n), yerr_sol(n_sol,n);
133 this->
template solve_store<ubmatrix,ubmatrix_row>
134 (x0,
x1,h,n,ystart,n_sol,x_sol,ysol,dydx_sol,yerr_sol,derivs);
137 std::vector<ubvector *> yt, dyt, errt;
143 for(
size_t i=0;i<n;i++) {
178 #ifndef DOXYGEN_NO_O2NS double get(std::string scol, size_t row) const
Get value from row row of column named col. .
Solve an initial-value ODE problems given an adaptive ODE stepper.
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
size_t get_nlines() const
Return the number of lines.
void set_nlines(size_t il)
Set the number of lines.
const vec_t & get_column(std::string scol) const
Returns a reference to the column named col. .
void vector_copy(const vec_t &src, vec2_t &dest)
Simple vector copy.
int solve_store_table(double x0, double x1, double h, size_t n, vec_t &ystart, size_t &n_sol, table<> &t, std::string x_col, std::string y_prefix, std::string dydx_prefix, std::string yerr_prefix, func_t &derivs)
Desc.
Solve an initial-value ODE problem and store the result in a table object.
int solve_grid_table(size_t n, vec_t &ystart, table<> &t, std::string x_col, std::string y_prefix, std::string dydx_prefix, std::string yerr_prefix, func_t &derivs)
Desc.
void new_column(std::string head)
Add a new column owned by the table table .
bool is_column(std::string scol) const
Return true if scol is a column in the current table table .
static const double x1[5]