26 #if defined (HAVE_CONFIG_H)
69 tmp_deriv = (*user_fun) (*
tmp_x, time);
75 for (
F77_INT i = 0; i < neq; i++)
76 deriv[i] = tmp_deriv.
elem (i);
92 tmp_jac = (*user_jac) (*
tmp_x, time);
94 for (
F77_INT j = 0; j < neq; j++)
95 for (
F77_INT i = 0; i < neq; i++)
96 pd[nrowpd * j + i] = tmp_jac (i, j);
122 if (integration_method () ==
"stiff")
132 lrw = 22 +
n * (9 +
n);
146 for (
F77_INT i = 4; i < 9; i++)
151 for (
F77_INT i = 4; i < 9; i++)
158 if (maxord > 0 && maxord <= max_maxord)
160 iwork(4) = octave::to_f77_int (maxord);
166 (*current_liboctave_error_handler)
167 (
"lsode: invalid value for maximum order");
202 (*current_liboctave_error_handler)
203 (
"lsode: inconsistent sizes for state and derivative vectors");
213 rel_tol = relative_tolerance ();
214 abs_tol = absolute_tolerance ();
218 if (abs_tol_len == 1)
220 else if (abs_tol_len ==
n)
225 (*current_liboctave_error_handler)
226 (
"lsode: inconsistent sizes for state and absolute tolerance vectors");
232 double iss = initial_step_size ();
239 double maxss = maximum_step_size ();
246 double minss = minimum_step_size ();
253 F77_INT sl = octave::to_f77_int (step_limit ());
260 LSODE_options::reset =
false;
300 (*current_liboctave_error_handler)
301 (
"unrecognized value of istate (= %" OCTAVE_IDX_TYPE_FORMAT
") "
302 "returned from lsode",
istate);
314 std::ostringstream buf;
316 std::string t_curr = buf.str ();
321 retval =
"prior to initial integration step";
325 retval =
"successful exit";
329 retval =
"prior to continuation call with modified parameters";
333 retval =
"excess work on this call (t = " + t_curr +
334 "; perhaps wrong integration method)";
338 retval =
"excess accuracy requested (tolerances too small)";
342 retval =
"invalid input detected (see printed message)";
346 retval =
"repeated error test failures (t = " + t_curr +
347 "; check all inputs)";
351 retval =
"repeated convergence failures (t = " + t_curr +
352 "; perhaps bad Jacobian supplied or wrong choice of integration method or tolerances)";
356 retval =
"error weight became zero during problem. (t = " + t_curr +
357 "; solution component i vanished, and atol or atol(i) == 0)";
361 retval =
"return requested in user-supplied function (t = "
366 retval =
"unknown error state";
381 if (n_out > 0 &&
n > 0)
411 if (n_out > 0 &&
n > 0)
424 double next_crit = tcrit.
elem (0);
426 while (i_out < n_out)
428 bool do_restart =
false;
430 next_out = tout.
elem (i_out);
432 next_crit = tcrit.
elem (i_crit);
434 bool save_output =
false;
437 if (next_crit == next_out)
446 else if (next_crit < next_out)
F77_INT(* lsode_jac_ptr)(const F77_INT &, const double &, double *, const F77_INT &, const F77_INT &, double *, const F77_INT &)
static F77_INT lsode_f(const F77_INT &neq, const double &time, double *, double *deriv, F77_INT &ierr)
F77_INT(* lsode_fcn_ptr)(const F77_INT &, const double &, double *, double *, F77_INT &)
static ODEFunc::ODEJacFunc user_jac
F77_RET_T F77_FUNC(dlsode, DLSODE)(lsode_fcn_ptr
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
static ColumnVector * tmp_x
static F77_INT lsode_j(const F77_INT &neq, const double &time, double *, const F77_INT &, const F77_INT &, double *pd, const F77_INT &nrowpd)
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
octave_idx_type numel(void) const
Number of elements in the array.
T & elem(octave_idx_type n)
Size of the specified dimension.
const T * fortran_vec(void) const
Size of the specified dimension.
bool isempty(void) const
Size of the specified dimension.
std::string error_message(void) const
ColumnVector do_integrate(double t)
octave_f77_int_type method_flag
octave_f77_int_type itask
Array< octave_f77_int_type > iwork
ColumnVector(* ODERHSFunc)(const ColumnVector &, double)
Matrix(* ODEJacFunc)(const ColumnVector &, double)
ODEJacFunc jacobian_function(void) const
virtual void force_restart(void)
octave_idx_type size(void) const
void set_stop_time(double tt)
void clear_stop_time(void)
Vector representing the dimensions (size) of an Array.
subroutine dlsode(F, NEQ, Y, T, TOUT, ITOL, RTOL, ATOL, ITASK, ISTATE, IOPT, RWORK, LRW, IWORK, LIW, JAC, MF)
#define F77_XFCN(f, F, args)
octave_f77_int_type F77_INT
F77_RET_T(F77_CONST_CHAR_ARG_DECL, F77_CONST_CHAR_ARG_DECL, F77_CONST_CHAR_ARG_DECL, const F77_INT &, const F77_INT &, const F77_INT &, F77_INT &, F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, F77_DBLE *, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, F77_INT *, F77_INT &F77_CHAR_ARG_LEN_DECL F77_CHAR_ARG_LEN_DECL F77_CHAR_ARG_LEN_DECL)
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE const F77_INT F77_INT & ierr
octave_value::octave_value(const Array< char > &chm, char type) return retval