Mercurial > hg > octave-nkf
changeset 3876:a134e5cfdc01
[project @ 2002-03-07 18:57:46 by jwe]
author | jwe |
---|---|
date | Thu, 07 Mar 2002 18:57:46 +0000 |
parents | 09323fcea5ab |
children | 55648fc616c8 |
files | scripts/ChangeLog scripts/statistics/base/center.m src/ChangeLog src/ov-usr-fcn.cc |
diffstat | 4 files changed, 32 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2002-03-07 Paul Kienzle <pkienzle@kienzle.powernet.co.uk> + + * statistics/base/center.m: Accept and return empty matrix. + 2002-02-22 John W. Eaton <jwe@bevo.che.wisc.edu> * specfun/erfinv.m: Fix usage message.
--- a/scripts/statistics/base/center.m +++ b/scripts/statistics/base/center.m @@ -29,10 +29,12 @@ usage ("center (x)"); endif - if is_vector (x) - retval = x - mean(x); - elseif is_matrix (x) - retval = x - ones (rows (x), 1) * mean(x); + if (is_vector (x)) + retval = x - mean (x); + elseif (is_matrix (x)) + retval = x - ones (rows (x), 1) * mean (x); + elseif (isempty (x)) + retval = x; else error ("center: x must be a vector or a matrix"); endif
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,23 @@ +2002-03-06 John W. Eaton <jwe@bevo.che.wisc.edu> + + * ov-usr-fcn.cc (octave_user_function::do_multi_index_op): + Don't unwind_protect num_named_args (it doesn't change on + recursive calls). + Do re-initialize curr_va_arg_number to num_named_args after + unwind_protecting. + + * ov-usr-fcn.h (octave_user_function::clear_args_passed): Delete. + (octave_user_function::saved_args): New data member. + (octave_user_function::save_args_passed): New function. + (octave_user_function::restore_args_passed): Ditto. + * ov-usr-fcn.cc (clear_args_passed): Delete. + (restore_args_passed): New function. + (octave_user_function::do_multi_index_op): Correctly save and + restore args passed for recursive calls. + + * TEMPLATE-INST/SLStack-ovl.cc: New file. + * Makefile.in: Add it to the list. + 2002-02-22 John W. Eaton <jwe@bevo.che.wisc.edu> * ov-usr-fcn.cc (octave_user_function::do_multi_index_op):
--- a/src/ov-usr-fcn.cc +++ b/src/ov-usr-fcn.cc @@ -334,9 +334,10 @@ unwind_protect_int (num_args_passed); num_args_passed = nargin; - unwind_protect_int (num_named_args); unwind_protect_int (curr_va_arg_number); + curr_va_arg_number = num_named_args; + if (param_list && ! param_list->varargs_only ()) { param_list->define_from_arg_vector (args);