23 #if defined (HAVE_CONFIG_H)
38 const double&,
double*,
42 const double&,
double*,
51 F77_DBLE&, F77_DBLE&, F77_INT&, F77_DBLE&,
52 const F77_DBLE*, F77_INT&,
54 F77_DBLE*, F77_INT&, F77_INT*,
67 BEGIN_INTERRUPT_WITH_EXCEPTIONS;
75 tmp_deriv = (*user_fun) (*
tmp_x, time);
82 deriv[
i] = tmp_deriv.
elem (
i);
85 END_INTERRUPT_WITH_EXCEPTIONS;
95 BEGIN_INTERRUPT_WITH_EXCEPTIONS;
103 tmp_jac = (*user_jac) (*
tmp_x, time);
107 pd[nrowpd * j +
i] = tmp_jac (
i, j);
109 END_INTERRUPT_WITH_EXCEPTIONS;
145 lrw = 22 + n * (9 + n);
179 (*current_liboctave_error_handler)
180 (
"lsode: invalid value for maximum order");
212 if (x.numel () != xdot.
numel ())
215 (*current_liboctave_error_handler)
216 (
"lsode: inconsistent sizes for state and derivative vectors");
231 if (abs_tol_len == 1)
233 else if (abs_tol_len == n)
238 (*current_liboctave_error_handler)
239 (
"lsode: inconsistent sizes for state and absolute tolerance vectors");
309 (*current_liboctave_error_handler)
310 (
"unrecognized value of istate (= %d) returned from lsode",
istate);
322 std::ostringstream buf;
329 retval =
"prior to initial integration step";
333 retval =
"successful exit";
337 retval =
"prior to continuation call with modified parameters";
341 retval =
std::string (
"excess work on this call (t = ")
342 + t_curr +
"; perhaps wrong integration method)";
346 retval =
"excess accuracy requested (tolerances too small)";
350 retval =
"invalid input detected (see printed message)";
354 retval =
std::string (
"repeated error test failures (t = ")
355 + t_curr +
"; check all inputs)";
359 retval =
std::string (
"repeated convergence failures (t = ")
361 +
"; perhaps bad Jacobian supplied or wrong choice of integration method or tolerances)";
365 retval =
std::string (
"error weight became zero during problem. (t = ")
367 +
"; solution component i vanished, and atol or atol(i) == 0)";
371 retval =
"return requested in user-supplied function (t = "
376 retval =
"unknown error state";
391 if (n_out > 0 && n > 0)
421 if (n_out > 0 && n > 0)
434 double next_crit = tcrit.
elem (0);
436 while (i_out < n_out)
438 bool do_restart =
false;
440 next_out = tout.
elem (i_out);
442 next_crit = tcrit.
elem (i_crit);
447 if (next_crit == next_out)
456 else if (next_crit < next_out)
double relative_tolerance(void) const
F77_RET_T F77_INT F77_DBLE F77_DBLE F77_DBLE F77_INT F77_DBLE const F77_DBLE F77_INT F77_INT F77_INT F77_DBLE F77_INT F77_INT F77_INT F77_INT &static ODEFunc::ODERHSFunc user_fun
Matrix(* ODEJacFunc)(const ColumnVector &, double)
octave_idx_type(* lsode_fcn_ptr)(const octave_idx_type &, const double &, double *, double *, octave_idx_type &)
bool is_empty(void) const
octave_idx_type size(void) const
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE const F77_INT F77_INT * ierr
static octave_idx_type lsode_j(const octave_idx_type &neq, const double &time, double *, const octave_idx_type &, const octave_idx_type &, double *pd, const octave_idx_type &nrowpd)
double maximum_step_size(void) const
ColumnVector(* ODERHSFunc)(const ColumnVector &, double)
void resize(octave_idx_type nr, octave_idx_type nc, double rfv=0)
octave_idx_type method_flag
Array< double > absolute_tolerance(void) const
double initial_step_size(void) const
static ColumnVector * tmp_x
subroutine dlsode(F, NEQ, Y, T, TOUT, ITOL, RTOL, ATOL, ITASK, ISTATE, IOPT, RWORK, LRW, IWORK, LIW, JAC, MF)
octave_idx_type numel(void) const
Number of elements in the array.
octave_idx_type(* lsode_jac_ptr)(const octave_idx_type &, const double &, double *, const octave_idx_type &, const octave_idx_type &, double *, const octave_idx_type &)
static octave_idx_type nn
F77_RET_T F77_FUNC(dlsode, DLSODE)(lsode_fcn_ptr
Array< octave_idx_type > iwork
std::string integration_method(void) const
ColumnVector do_integrate(double t)
T & elem(octave_idx_type n)
#define F77_XFCN(f, F, args)
virtual void force_restart(void)
void set_stop_time(double tt)
octave_idx_type step_limit(void) const
void resize(const dim_vector &dv, const T &rfv)
void clear_stop_time(void)
static ODEFunc::ODEJacFunc user_jac
octave_idx_type maximum_order(void) const
=val(i)}if ode{val(i)}occurs in table i
static octave_idx_type lsode_f(const octave_idx_type &neq, const double &time, double *, double *deriv, octave_idx_type &ierr)
const T * fortran_vec(void) const
double minimum_step_size(void) const
Vector representing the dimensions (size) of an Array.
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
ODEJacFunc jacobian_function(void) const
std::string error_message(void) const