38 const double*,
double*,
43 const double*,
double*,
44 const double&,
double*,
51 double&,
double*,
double*,
double&,
52 const octave_idx_type*,
const double*,
53 const double*, octave_idx_type&,
54 double*,
const octave_idx_type&,
55 octave_idx_type*,
const octave_idx_type&,
56 const double*,
const octave_idx_type*,
69 BEGIN_INTERRUPT_WITH_EXCEPTIONS;
79 tmp_deriv.
elem (i) = deriv[i];
80 tmp_state.
elem (i) = state[i];
83 tmp_delta =
user_fun (tmp_state, tmp_deriv, time, ires);
87 if (tmp_delta.
length () == 0)
92 delta[i] = tmp_delta.
elem (i);
96 END_INTERRUPT_WITH_EXCEPTIONS;
105 BEGIN_INTERRUPT_WITH_EXCEPTIONS;
114 tmp_deriv.
elem (i) = deriv[i];
115 tmp_state.
elem (i) = state[i];
122 pd[nn * j + i] = tmp_pd.
elem (i, j);
124 END_INTERRUPT_WITH_EXCEPTIONS;
148 lrw = 40 + 9*n + n*n;
178 if (res.
length () != x.length ())
180 (*current_liboctave_error_handler)
181 (
"dassl: inconsistent sizes for state and residual vectors");
189 (*current_liboctave_error_handler)
190 (
"dassl: no user supplied RHS subroutine!");
231 if (maxord > 0 && maxord < 6)
238 (*current_liboctave_error_handler)
239 (
"dassl: invalid value for maximum order: %d", maxord);
246 info(9) = enc ? 1 : 0;
249 info(10) = ccic ? 1 : 0;
257 if (abs_tol_len == 1 && rel_tol_len == 1)
261 else if (abs_tol_len == n && rel_tol_len == n)
267 (*current_liboctave_error_handler)
268 (
"dassl: inconsistent sizes for tolerance arrays");
335 (*current_liboctave_error_handler)
336 (
"unrecognized value of istate (= %d) returned from ddassl",
359 if (n_out > 0 && n > 0)
362 xdot_out.
resize (n_out, n);
379 retval.
elem (j, i) = x_next.
elem (i);
404 if (n_out > 0 && n > 0)
407 xdot_out.
resize (n_out, n);
421 double next_crit = tcrit.
elem (0);
423 while (i_out < n_out)
425 bool do_restart =
false;
427 next_out = tout.
elem (i_out);
429 next_crit = tcrit.
elem (i_crit);
434 if (next_crit == next_out)
443 else if (next_crit < next_out)
478 retval.
elem (i_out-1, i) = x_next.
elem (i);
504 std::ostringstream buf;
506 std::string t_curr = buf.str ();
511 retval =
"a step was successfully taken in intermediate-output mode.";
515 retval =
"integration completed by stepping exactly to TOUT";
519 retval =
"integration to tout completed by stepping past TOUT";
523 retval = std::string (
"a large amount of work has been expended (t =")
528 retval =
"the error tolerances are too stringent";
532 retval = std::string (
"error weight became zero during problem. (t = ")
534 +
"; solution component i vanished, and atol or atol(i) == 0)";
538 retval = std::string (
"repeated error test failures on the last attempted step (t = ")
543 retval = std::string (
"the corrector could not converge (t = ")
548 retval = std::string (
"the matrix of partial derivatives is singular (t = ")
553 retval = std::string (
"the corrector could not converge (t = ")
554 + t_curr +
"; repeated test failures)";
558 retval = std::string (
"corrector could not converge because IRES was -1 (t = ")
563 retval = std::string (
"return requested in user-supplied function (t = ")
568 retval =
"failed to compute consistent initial conditions";
572 retval =
"unrecoverable error (see printed message)";
576 retval =
"unknown error state";