144 double hmx, tol, sum;
149 C_INT len1c, len1n, len1s, iflag;
151 C_INT leniw, lenwm = 0, imxer;
154 double tdist, rtoli, tolsf, tnext;
1174 if (*istate < 1 || *istate > 3)
1179 if (*itask < 1 || *itask > 5)
1237 if (*itol < 1 || *itol > 4)
1242 if (*iopt < 0 || *iopt > 1)
1247 if (*jt == 3 || *jt < 1 || *jt > 5)
1360 if ((*tout - *t) * h0 < 0.)
1424 lenwm = ((ml << 1) + mu + 1) *
dls001_1.n + 2;
1437 lenrw = len1 + len2;
1438 lenrwc = len1c + len2;
1451 if (*istate == 1 && *lrw < lenrwc)
1456 if (*istate == 1 && *liw < leniwc)
1461 if (*istate == 3 && *lrw < lenrwc)
1466 if (*istate == 3 && *liw < leniwc)
1481 msg =
"DLSODA- Warning.. RWORK length is sufficient for now, but ";
1484 msg =
" may not be later. Integration will proceed anyway. ";
1487 msg =
" Length needed is LENRW = I1, while LRW = I2.";
1501 msg =
"DLSODA- Warning.. IWORK length is sufficient for now, but ";
1504 msg =
" may not be later. Integration will proceed anyway. ";
1507 msg =
" Length needed is LENIW = I1, while LIW = I2.";
1516 for (i__ = 1; i__ <= i__1; ++i__)
1523 if (*itol == 2 || *itol == 4)
1565 for (i__ = i1; i__ <= i__1; ++i__)
1580 dls001_1.uround = std::numeric_limits< C_FLOAT64 >::epsilon();
1585 if (*itask != 4 && *itask != 5)
1592 if ((tcrit - *tout) * (*tout - *t) < 0.)
1597 if (h0 != 0. && (*t + h0 - tcrit) * h0 > 0.)
1618 f(&neq[1], t, &y[1], &rwork[lf0]);
1623 for (i__ = 1; i__ <= i__1; ++i__)
1626 rwork[i__ +
dls001_1.lyh - 1] = y[i__];
1636 for (i__ = 1; i__ <= i__1; ++i__)
1638 if (rwork[i__ +
dls001_1.lewt - 1] <= 0.)
1678 tdist = (d__1 = *tout - *t, fabs(d__1));
1680 d__1 = fabs(*t), d__2 = fabs(*tout);
1683 if (tdist <
dls001_1.uround * 2. * w0)
1697 for (i__ = 1; i__ <= i__1; ++i__)
1701 d__1 = tol, d__2 = rtol[i__];
1715 for (i__ = 1; i__ <= i__1; ++i__)
1717 if (*itol == 2 || *itol == 4)
1722 ayi = (d__1 = y[i__], fabs(d__1));
1727 d__1 = tol, d__2 = atoli / ayi;
1736 d__1 = tol, d__2 =
dls001_1.uround * 100.;
1742 sum = 1. / (tol * w0 * w0) + tol * (d__1 * d__1);
1743 h0 = 1. / sqrt(sum);
1760 for (i__ = 1; i__ <= i__1; ++i__)
1763 rwork[i__ + lf0 - 1] = h0 * rwork[i__ + lf0 - 1];
1803 if ((tp - *tout) *
dls001_1.h__ > 0.)
1823 if ((tcrit - *tout) *
dls001_1.h__ < 0.)
1852 ihit = (d__1 =
dls001_1.tn - tcrit, fabs(d__1)) <=
dls001_1.uround * 100. *
1867 if ((tnext - tcrit) *
dls001_1.h__ <= 0.)
1874 if (*istate == 2 &&
dls001_1.jstart >= 0)
1918 for (i__ = 1; i__ <= i__1; ++i__)
1920 if (rwork[i__ +
dls001_1.lewt - 1] <= 0.)
1960 msg =
"DLSODA- Warning..Internal T (=R1) and H (=R2) are";
1963 msg =
" such that in the machine, T + H = T on the next step ";
1966 msg =
" (H = step size). Solver will continue anyway.";
1975 msg =
"DLSODA- Above warning has been issued I1 times. ";
1978 msg =
" It will not be issued again for this problem.";
2038 msg =
"DLSODA- A switch to the BDF (stiff) method has occurred";
2045 msg =
"DLSODA- A switch to the Adams (nonstiff) method has occ urred";
2050 msg =
" at T = R1, tentative step size H = R2, step NST = I1 ";
2097 ihit = (d__1 =
dls001_1.tn - tcrit, fabs(d__1)) <=
dls001_1.uround * 100. *
2107 if ((tnext - tcrit) *
dls001_1.h__ <= 0.)
2123 ihit = (d__1 =
dls001_1.tn - tcrit, fabs(d__1)) <=
dls001_1.uround * 100. *
2135 for (i__ = 1; i__ <= i__1; ++i__)
2138 y[i__] = rwork[i__ +
dls001_1.lyh - 1];
2143 if (*itask != 4 && *itask != 5)
2177 msg =
"DLSODA- At current T (=R1), MXSTEP (=I1) steps ";
2180 msg =
" taken on this call before reaching TOUT ";
2187 ewti = rwork[
dls001_1.lewt + i__ - 1];
2188 msg =
"DLSODA- At T (=R1), EWT(I1) has become R2 .le. 0.";
2195 msg =
"DLSODA- At T (=R1), too much accuracy requested ";
2198 msg =
" for precision of machine.. See TOLSF (=R2) ";
2206 msg =
"DLSODA- At T(=R1) and step size H(=R2), the error";
2209 msg =
" test failed repeatedly or with ABS(H) = HMIN";
2216 msg =
"DLSODA- At T (=R1) and step size H (=R2), the ";
2219 msg =
" corrector convergence failed repeatedly ";
2222 msg =
" or with ABS(H) = HMIN ";
2229 msg =
"DLSODA- At current T(=R1), RWORK length too small";
2232 msg =
" to proceed. The integration was otherwise successful.";
2239 msg =
"DLSODA- At current T(=R1), IWORK length too small";
2242 msg =
" to proceed. The integration was otherwise successful.";
2253 for (i__ = 1; i__ <= i__1; ++i__)
2255 size = (d__1 = rwork[i__ +
dls001_1.lacor - 1] * rwork[i__ +
2274 for (i__ = 1; i__ <= i__1; ++i__)
2277 y[i__] = rwork[i__ +
dls001_1.lyh - 1];
2301 msg =
"DLSODA- ISTATE (=I1) illegal.";
2312 msg =
"DLSODA- ITASK (=I1) illegal. ";
2317 msg =
"DLSODA- ISTATE .gt. 1 but DLSODA not initialized.";
2322 msg =
"DLSODA- NEQ (=I1) .lt. 1 ";
2327 msg =
"DLSODA- ISTATE = 3 and NEQ increased (I1 to I2). ";
2332 msg =
"DLSODA- ITOL (=I1) illegal. ";
2337 msg =
"DLSODA- IOPT (=I1) illegal. ";
2342 msg =
"DLSODA- JT (=I1) illegal. ";
2347 msg =
"DLSODA- ML (=I1) illegal: .lt.0 or .ge.NEQ (=I2) ";
2352 msg =
"DLSODA- MU (=I1) illegal: .lt.0 or .ge.NEQ (=I2) ";
2357 msg =
"DLSODA- IXPR (=I1) illegal. ";
2362 msg =
"DLSODA- MXSTEP (=I1) .lt. 0 ";
2367 msg =
"DLSODA- MXHNIL (=I1) .lt. 0 ";
2372 msg =
"DLSODA- TOUT (=R1) behind T (=R2) ";
2373 mxerrwd(msg, &
c__40, &
c__14, &
c__0, &
c__0, &
c__0, &
c__0, &
c__2, tout, t, (
2375 msg =
" Integration direction is given by H0 (=R1) ";
2380 msg =
"DLSODA- HMAX (=R1) .lt. 0.0 ";
2385 msg =
"DLSODA- HMIN (=R1) .lt. 0.0 ";
2390 msg =
"DLSODA- RWORK length needed, LENRW (=I1), exceeds LRW (=I2)";
2395 msg =
"DLSODA- IWORK length needed, LENIW (=I1), exceeds LIW (=I2)";
2400 msg =
"DLSODA- RTOL(I1) is R1 .lt. 0.0 ";
2405 msg =
"DLSODA- ATOL(I1) is R1 .lt. 0.0 ";
2410 ewti = rwork[
dls001_1.lewt + i__ - 1];
2411 msg =
"DLSODA- EWT(I1) is R1 .le. 0.0 ";
2416 msg =
"DLSODA- TOUT(=R1) too close to T(=R2) to start integration.";
2417 mxerrwd(msg, &
c__60, &
c__22, &
c__0, &
c__0, &
c__0, &
c__0, &
c__2, tout, t,
2421 msg =
"DLSODA- ITASK = I1 and TOUT (=R1) behind TCUR - HU (= R2) ";
2422 mxerrwd(msg, &
c__60, &
c__23, &
c__0, &
c__1, itask, &
c__0, &
c__2, tout, &tp,
2426 msg =
"DLSODA- ITASK = 4 or 5 and TCRIT (=R1) behind TCUR (=R2) ";
2431 msg =
"DLSODA- ITASK = 4 or 5 and TCRIT (=R1) behind TOUT (=R2) ";
2436 msg =
"DLSODA- At start of problem, too much accuracy ";
2439 msg =
" requested for precision of machine.. See TOLSF (=R1) ";
2445 msg =
"DLSODA- Trouble in DINTDY. ITASK = I1, TOUT = R1";
2450 msg =
"DLSODA- MXORDN (=I1) .lt. 0 ";
2455 msg =
"DLSODA- MXORDS (=I1) .lt. 0 ";
2464 msg =
"DLSODA- Run aborted.. apparent infinite loop. ";
C_INT dstoda_(C_INT *neq, double *y, double *yh, C_INT *nyh, double *yh1, double *ewt, double *savf, double *acor, double *wm, C_INT *iwm, evalF f, evalJ jac, PJAC *pjac, SLVS *slvs)
static const C_INT mord[2]
C_INT dintdy_(double *t, const C_INT *k, double *yh, C_INT *nyh, double *dky, C_INT *iflag)
static const C_INT mxhnl0
static const C_INT c__202
C_INT dewset_(C_INT *n, C_INT *itol, double *rtol, double *atol, double *ycur, double *ewt)
static const C_INT c__106
static const C_INT c__207
static const double c_b76
static const C_INT c__107
static const C_INT c__103
static const C_INT mxstp0
static const C_INT c__205
static const C_INT c__104
static const C_INT c__204
static const C_INT c__203
static const C_INT c__102
double dmnorm_(C_INT *n, double *v, double *w)
double d_sign(const double &a, const double &b)
static const C_INT c__105
static const C_INT c__303
static const C_INT c__206
static const C_INT c__101
static const C_INT c__201