# HG changeset patch # User jwe # Date 1036608110 0 # Node ID f14251d33b01853c0143efa6ce15349b090da8fb # Parent 8b113cca48f1876a80a9e58b7d7477823c9eebcf [project @ 2002-11-06 18:41:50 by jwe] diff -r 8b113cca48f1 -r f14251d33b01 liboctave/Array.h --- a/liboctave/Array.h Mon Nov 04 22:11:26 2002 +0000 +++ b/liboctave/Array.h Wed Nov 06 18:41:50 2002 +0000 @@ -29,6 +29,7 @@ #endif #include +#include #include diff -r 8b113cca48f1 -r f14251d33b01 liboctave/ChangeLog --- a/liboctave/ChangeLog Mon Nov 04 22:11:26 2002 +0000 +++ b/liboctave/ChangeLog Wed Nov 06 18:41:50 2002 +0000 @@ -1,3 +1,9 @@ +2002-11-06 John W. Eaton + + * ODESSA.cc (odessa_f, odessa_j, odessa_b): Abort on error. + + * Array.h: Include here. + 2002-11-01 John W. Eaton * DASPK.cc (DASPK::do_integrate): Resize rwork and iwork before diff -r 8b113cca48f1 -r f14251d33b01 liboctave/ODESSA.cc --- a/liboctave/ODESSA.cc Mon Nov 04 22:11:26 2002 +0000 +++ b/liboctave/ODESSA.cc Wed Nov 06 18:41:50 2002 +0000 @@ -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; } diff -r 8b113cca48f1 -r f14251d33b01 src/ChangeLog --- a/src/ChangeLog Mon Nov 04 22:11:26 2002 +0000 +++ b/src/ChangeLog Wed Nov 06 18:41:50 2002 +0000 @@ -1,3 +1,8 @@ +2002-11-06 John W. Eaton + + * DLD-FUNCTIONS/odessa.cc (Fodessa): Correctly extract bsub from + function arg. + 2002-11-04 John W. Eaton * cutils.c (octave_vsnprintf): Handle C99 snprintf semantics. diff -r 8b113cca48f1 -r f14251d33b01 src/DLD-FUNCTIONS/odessa.cc --- a/src/DLD-FUNCTIONS/odessa.cc Mon Nov 04 22:11:26 2002 +0000 +++ b/src/DLD-FUNCTIONS/odessa.cc Wed Nov 06 18:41:50 2002 +0000 @@ -464,7 +464,7 @@ if (odessa_j && nr == 3) { odessa_b = extract_function - (tmp(1), "odessa", "__odessa_b__", + (tmp(2), "odessa", "__odessa_b__", "function dfdp = __odessa_b__ (x, t, p, c) dfdp = ", "; endfunction");