# HG changeset patch # User jwe # Date 1015527466 0 # Node ID a134e5cfdc01ee4358aeead816cba0f7c169576b # Parent 09323fcea5ab324fd6a023f432204d1234cd4f45 [project @ 2002-03-07 18:57:46 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2002-03-07 Paul Kienzle + + * statistics/base/center.m: Accept and return empty matrix. + 2002-02-22 John W. Eaton * specfun/erfinv.m: Fix usage message. diff --git a/scripts/statistics/base/center.m b/scripts/statistics/base/center.m --- 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 diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,23 @@ +2002-03-06 John W. Eaton + + * 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 * ov-usr-fcn.cc (octave_user_function::do_multi_index_op): diff --git a/src/ov-usr-fcn.cc b/src/ov-usr-fcn.cc --- 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);