38 const double*,
double*,
43 const double*,
double*,
44 const double&,
double*,
48 const double&,
const double*,
57 double&,
double*,
double*,
const double&,
58 octave_idx_type*,
const double*,
59 const double*, octave_idx_type&,
double*,
60 const octave_idx_type&, octave_idx_type*,
61 const octave_idx_type&,
double*,
77 BEGIN_INTERRUPT_WITH_EXCEPTIONS;
84 tmp_state(i) = state[i];
85 tmp_deriv(i) = deriv[i];
88 ColumnVector tmp_fval = (*user_fsub) (tmp_state, tmp_deriv, t, ires);
90 if (tmp_fval.
length () == 0)
95 delta[i] = tmp_fval(i);
98 END_INTERRUPT_WITH_EXCEPTIONS;
107 BEGIN_INTERRUPT_WITH_EXCEPTIONS;
116 tmp_deriv.
elem (i) = deriv[i];
117 tmp_state.
elem (i) = state[i];
120 Matrix tmp_pd = (*user_jsub) (tmp_state, tmp_deriv, time, cj);
124 pd[nn * j + i] = tmp_pd.
elem (i, j);
126 END_INTERRUPT_WITH_EXCEPTIONS;
135 BEGIN_INTERRUPT_WITH_EXCEPTIONS;
141 tmp_state(i) = state[i];
146 gout[i] = tmp_fval(i);
148 END_INTERRUPT_WITH_EXCEPTIONS;
193 if (maxord > 0 && maxord < 6)
200 (*current_liboctave_error_handler)
201 (
"dassl: invalid value for maximum order");
208 lrw = 50 + 9*n + n*n + 3*
ng;
236 if (fval.
length () != x.length ())
238 (*current_liboctave_error_handler)
239 (
"dasrt: inconsistent sizes for state and residual vectors");
247 (*current_liboctave_error_handler)
248 (
"dasrt: no user supplied RHS subroutine!");
296 if (abs_tol_len == 1 && rel_tol_len == 1)
300 else if (abs_tol_len == n && rel_tol_len == n)
306 (*current_liboctave_error_handler)
307 (
"dasrt: inconsistent sizes for tolerance arrays");
380 (*current_liboctave_error_handler)
381 (
"unrecognized value of istate (= %d) returned from ddasrt",
399 if (n_out > 0 && n > 0)
402 xdot_out.
resize (n_out, n);
407 xdot_out(0,i) =
xdot(i);
428 xdot_out(j,i) =
xdot(i);
458 if (n_out > 0 && n > 0)
461 xdot_out.
resize (n_out, n);
469 double next_crit = tcrit(0);
471 while (i_out < n_out)
473 bool do_restart =
false;
475 next_out = tout(i_out);
477 next_crit = tcrit(i_crit);
482 if (next_crit == next_out)
491 else if (next_crit < next_out)
532 x_out(i_out-1,i) =
x(i);
533 xdot_out(i_out-1,i) =
xdot(i);
536 t_outs(i_out-1) = t_out;
541 xdot_out.
resize (i_out, n);
570 std::ostringstream buf;
572 std::string t_curr = buf.str ();
577 retval =
"a step was successfully taken in intermediate-output mode.";
581 retval =
"integration completed by stepping exactly to TOUT";
585 retval =
"integration to tout completed by stepping past TOUT";
589 retval =
"integration completed by finding one or more roots of G at T";
593 retval = std::string (
"a large amount of work has been expended (t =")
598 retval =
"the error tolerances are too stringent";
602 retval = std::string (
"error weight became zero during problem. (t = ")
604 +
"; solution component i vanished, and atol or atol(i) == 0)";
608 retval = std::string (
"repeated error test failures on the last attempted step (t = ")
613 retval = std::string (
"the corrector could not converge (t = ")
618 retval = std::string (
"the matrix of partial derivatives is singular (t = ")
623 retval = std::string (
"the corrector could not converge (t = ")
624 + t_curr +
"; repeated test failures)";
628 retval = std::string (
"corrector could not converge because IRES was -1 (t = ")
633 retval = std::string (
"return requested in user-supplied function (t = ")
638 retval =
"failed to compute consistent initial conditions";
642 retval =
"unrecoverable error (see printed message)";
646 retval =
"unknown error state";