Mercurial > hg > octave-terminal
changeset 4133:402d7b86a0a2
[project @ 2002-10-29 23:57:34 by jwe]
author | jwe |
---|---|
date | Tue, 29 Oct 2002 23:57:34 +0000 |
parents | 87eb044020ae |
children | 76d25b5e6223 |
files | libcruft/ChangeLog libcruft/dasrt/ddasrt.f liboctave/ChangeLog liboctave/DASRT.cc |
diffstat | 4 files changed, 48 insertions(+), 40 deletions(-) [+] |
line wrap: on
line diff
--- a/libcruft/ChangeLog +++ b/libcruft/ChangeLog @@ -1,3 +1,7 @@ +2002-10-29 John W. Eaton <jwe@bevo.che.wisc.edu> + + * dasrt/ddasrt.f (DDASRT): Fix computation of LENRW. + 2002-10-16 John W. Eaton <jwe@bevo.che.wisc.edu> * Makefile.in (install): Don't bother with versions for $(SHLBIN)
--- a/libcruft/dasrt/ddasrt.f +++ b/libcruft/dasrt/ddasrt.f @@ -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
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,5 +1,8 @@ 2002-10-29 John W. Eaton <jwe@bevo.che.wisc.edu> + * 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.
--- a/liboctave/DASRT.cc +++ b/liboctave/DASRT.cc @@ -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;