# HG changeset patch # User jwe # Date 1035935854 0 # Node ID 402d7b86a0a281f2eec86ecf3bdd40618a9059ff # Parent 87eb044020aeaa2466b1e5d444e8d002b8a8ea0e [project @ 2002-10-29 23:57:34 by jwe] diff -r 87eb044020ae -r 402d7b86a0a2 libcruft/ChangeLog --- a/libcruft/ChangeLog Tue Oct 29 21:21:45 2002 +0000 +++ b/libcruft/ChangeLog Tue Oct 29 23:57:34 2002 +0000 @@ -1,3 +1,7 @@ +2002-10-29 John W. Eaton + + * dasrt/ddasrt.f (DDASRT): Fix computation of LENRW. + 2002-10-16 John W. Eaton * Makefile.in (install): Don't bother with versions for $(SHLBIN) diff -r 87eb044020ae -r 402d7b86a0a2 libcruft/dasrt/ddasrt.f --- a/libcruft/dasrt/ddasrt.f Tue Oct 29 21:21:45 2002 +0000 +++ b/libcruft/dasrt/ddasrt.f Tue Oct 29 23:57:34 2002 +0000 @@ -442,13 +442,13 @@ C C LRW -- Set it to the declared length of the RWORK array. C You must have -C LRW .GE. 50+(MAXORD+4)*NEQ+NEQ**2 +C LRW .GE. 50+(MAXORD+4)*NEQ+NEQ**2+3*NG C for the full (dense) JACOBIAN case (when INFO(6)=0), or -C LRW .GE. 50+(MAXORD+4)*NEQ+(2*ML+MU+1)*NEQ +C LRW .GE. 50+(MAXORD+4)*NEQ+(2*ML+MU+1)*NEQ+3*NG C for the banded user-defined JACOBIAN case C (when INFO(5)=1 and INFO(6)=1), or C LRW .GE. 50+(MAXORD+4)*NEQ+(2*ML+MU+1)*NEQ -C +2*(NEQ/(ML+MU+1)+1) +C +2*(NEQ/(ML+MU+1)+1)+3*NG C for the banded finite-difference-generated JACOBIAN case C (when INFO(5)=0 and INFO(6)=1) C @@ -916,7 +916,7 @@ C COMPUTE MTYPE,LENPD,LENRW.CHECK ML AND MU. IF(INFO(6).NE.0)GO TO 40 LENPD=NEQ**2 - LENRW=50+(IWORK(LMXORD)+4)*NEQ+LENPD + LENRW=50+(IWORK(LMXORD)+4)*NEQ+LENPD+3*NG IF(INFO(5).NE.0)GO TO 30 IWORK(LMTYPE)=2 GO TO 60 @@ -929,10 +929,10 @@ IWORK(LMTYPE)=5 MBAND=IWORK(LML)+IWORK(LMU)+1 MSAVE=(NEQ/MBAND)+1 - LENRW=50+(IWORK(LMXORD)+4)*NEQ+LENPD+2*MSAVE + LENRW=50+(IWORK(LMXORD)+4)*NEQ+LENPD+2*MSAVE+3*NG GO TO 60 50 IWORK(LMTYPE)=4 - LENRW=50+(IWORK(LMXORD)+4)*NEQ+LENPD + LENRW=50+(IWORK(LMXORD)+4)*NEQ+LENPD+3*NG C C CHECK LENGTHS OF RWORK AND IWORK 60 LENIW=20+NEQ diff -r 87eb044020ae -r 402d7b86a0a2 liboctave/ChangeLog --- a/liboctave/ChangeLog Tue Oct 29 21:21:45 2002 +0000 +++ b/liboctave/ChangeLog Tue Oct 29 23:57:34 2002 +0000 @@ -1,5 +1,8 @@ 2002-10-29 John W. Eaton + * DASRT.cc (DASRT::integrate): Fix computation of lrw + (ddasrt_f): Combine loops. + * NLEqn.cc (NLEqn::solve): Return current estimate of solution instead of empty vector if user termninates iteration. diff -r 87eb044020ae -r 402d7b86a0a2 liboctave/DASRT.cc --- a/liboctave/DASRT.cc Tue Oct 29 21:21:45 2002 +0000 +++ b/liboctave/DASRT.cc Tue Oct 29 23:57:34 2002 +0000 @@ -64,12 +64,13 @@ double *delta, int& ires, double *rpar, int *ipar) { ColumnVector tmp_state (nn); - for (int i = 0; i < nn; i++) - tmp_state(i) = state[i]; + ColumnVector tmp_deriv (nn); - ColumnVector tmp_deriv (nn); for (int i = 0; i < nn; i++) - tmp_deriv(i) = deriv[i]; + { + tmp_state(i) = state[i]; + tmp_deriv(i) = deriv[i]; + } ColumnVector tmp_fval = (*user_fsub) (tmp_state, tmp_deriv, t, ires); @@ -153,8 +154,37 @@ nn = n; + // DAERTFunc + + user_csub = DAERTFunc::constraint_function (); + + if (user_csub) + { + ColumnVector tmp = (*user_csub) (x, t); + ng = tmp.length (); + } + else + ng = 0; + + int maxord = maximum_order (); + if (maxord >= 0) + { + if (maxord > 0 && maxord < 6) + { + info(8) = 1; + iwork(2) = maxord; + } + else + { + (*current_liboctave_error_handler) + ("dassl: invalid value for maximum order"); + integration_error = true; + return; + } + } + liw = 20 + n; - lrw = 50 + 9*n + n*n; + lrw = 50 + 9*n + n*n + 3*ng; iwork.resize (liw); rwork.resize (lrw); @@ -210,18 +240,6 @@ DAEFunc::reset = false; - // DAERTFunc - - user_csub = DAERTFunc::constraint_function (); - - if (user_csub) - { - ColumnVector tmp = (*user_csub) (x, t); - ng = tmp.length (); - } - else - ng = 0; - jroot.resize (ng, 1); pjroot = jroot.fortran_vec (); @@ -248,23 +266,6 @@ else info(7) = 0; - int maxord = maximum_order (); - if (maxord >= 0) - { - if (maxord > 0 && maxord < 6) - { - info(8) = 1; - iwork(2) = maxord; - } - else - { - (*current_liboctave_error_handler) - ("dassl: invalid value for maximum order"); - integration_error = true; - return; - } - } - if (step_limit () >= 0) { info(11) = 1;