Mercurial > hg > octave-terminal
changeset 4152:f14251d33b01
[project @ 2002-11-06 18:41:50 by jwe]
author | jwe |
---|---|
date | Wed, 06 Nov 2002 18:41:50 +0000 |
parents | 8b113cca48f1 |
children | 6b96ce9f5743 |
files | liboctave/Array.h liboctave/ChangeLog liboctave/ODESSA.cc src/ChangeLog src/DLD-FUNCTIONS/odessa.cc |
diffstat | 5 files changed, 35 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -29,6 +29,7 @@ #endif #include <cassert> +#include <cstddef> #include <iostream>
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2002-11-06 John W. Eaton <jwe@bevo.che.wisc.edu> + + * ODESSA.cc (odessa_f, odessa_j, odessa_b): Abort on error. + + * Array.h: Include <cstddef> here. + 2002-11-01 John W. Eaton <jwe@bevo.che.wisc.edu> * DASPK.cc (DASPK::do_integrate): Resize rwork and iwork before
--- a/liboctave/ODESSA.cc +++ b/liboctave/ODESSA.cc @@ -84,11 +84,12 @@ ColumnVector tmp_fval = user_fsub (tmp_state, t, tmp_param); - // Return the function value as a C array object - - for (int i = 0; i < n; i++) + if (tmp_fval.length () == 0) + longjmp (f77_context, 1); + else { - fval[i] = tmp_fval(i); + for (int i = 0; i < n; i++) + fval[i] = tmp_fval(i); } return 0; @@ -96,8 +97,8 @@ static int odessa_j (int* neq, const double& t, double *state, - double *par, const int& ml, const int& mu, double *pd, const - int& nrowpd) + double *par, const int& ml, const int& mu, double *pd, + const int& nrowpd) { int n = neq[0]; int n_par = neq[1]; @@ -113,9 +114,14 @@ Matrix tmp_fval = user_jsub (tmp_state, t, tmp_param); - for (int j = 0; j < n; j++) - for (int i = 0; i < nrowpd; i++) - pd[nrowpd*j+i] = tmp_fval(i,j); + if (tmp_fval.length () == 0) + longjmp (f77_context, 1); + else + { + for (int j = 0; j < n; j++) + for (int i = 0; i < nrowpd; i++) + pd[nrowpd*j+i] = tmp_fval(i,j); + } return 0; } @@ -139,8 +145,13 @@ ColumnVector tmp_fval = user_bsub (tmp_state, t, tmp_param, jpar); - for (int i = 0; i < n; i++) - dfdp[i] = tmp_fval(i); + if (tmp_fval.length () == 0) + longjmp (f77_context, 1); + else + { + for (int i = 0; i < n; i++) + dfdp[i] = tmp_fval(i); + } return 0; }
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-11-06 John W. Eaton <jwe@bevo.che.wisc.edu> + + * DLD-FUNCTIONS/odessa.cc (Fodessa): Correctly extract bsub from + function arg. + 2002-11-04 John W. Eaton <jwe@bevo.che.wisc.edu> * cutils.c (octave_vsnprintf): Handle C99 snprintf semantics.