Mercurial > hg > octave-nkf
changeset 5360:33adb987c033
[project @ 2005-05-23 16:19:56 by jwe]
author | jwe |
---|---|
date | Mon, 23 May 2005 16:19:56 +0000 |
parents | 17e40a1331b0 |
children | 0ac38aea9f76 |
files | src/ChangeLog src/DLD-FUNCTIONS/sort.cc src/debug.cc src/ov-cell.cc src/pr-output.cc src/pr-output.h |
diffstat | 6 files changed, 40 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,18 @@ +2005-05-23 John W. Eaton <jwe@octave.org> + + * debug.cc (Fdbwhere, get_user_function): Look at + curr_caller_function, not curr_function, since function is now set + inside mapper, built-in (and thereford dld) functions too. + 2005-05-21 John W. Eaton <jwe@octave.org> + * pr-output.cc, pr-output.h (Vprint_empty_dimensions): Now extern. + * ov-cell.cc (octave_cell::print_raw): Conditionally print + dimensions of empty 2-d cell arrays. + + * DLD-FUNCTIONS/sort.cc (mx_sort, mx_sort_indexed): Return empty + values for empty args. + * lex.l (handle_string): If single-quote string, \ and . have no special meaning.
--- a/src/DLD-FUNCTIONS/sort.cc +++ b/src/DLD-FUNCTIONS/sort.cc @@ -87,7 +87,7 @@ octave_value retval; if (m.length () < 1) - return retval; + return ArrayN<T> (); dim_vector dv = m.dims (); octave_idx_type ns = dv(dim); @@ -148,7 +148,11 @@ octave_value_list retval; if (m.length () < 1) - return retval; + { + retval(1) = NDArray (); + retval(0) = ArrayN<T> (); + return retval; + } dim_vector dv = m.dims (); octave_idx_type ns = dv(dim); @@ -296,7 +300,7 @@ octave_value retval; if (m.length () < 1) - return retval; + return ArrayN<double> (); dim_vector dv = m.dims (); octave_idx_type ns = dv(dim); @@ -433,7 +437,11 @@ octave_value_list retval; if (m.length () < 1) - return retval; + { + retval(1) = ArrayN<double> (); + retval(0) = NDArray (); + return retval; + } dim_vector dv = m.dims (); octave_idx_type ns = dv(dim);
--- a/src/debug.cc +++ b/src/debug.cc @@ -74,8 +74,8 @@ } } } - else if (curr_function && curr_function->is_user_function ()) - dbg_fcn = dynamic_cast<octave_user_function *> (curr_function); + else if (curr_caller_function && curr_caller_function->is_user_function ()) + dbg_fcn = dynamic_cast<octave_user_function *> (curr_caller_function); return dbg_fcn; } @@ -285,8 +285,8 @@ octave_user_function *dbg_fcn = 0; - if (curr_function && curr_function->is_user_function ()) - dbg_fcn = dynamic_cast<octave_user_function *> (curr_function); + if (curr_caller_function && curr_caller_function->is_user_function ()) + dbg_fcn = dynamic_cast<octave_user_function *> (curr_caller_function); if (dbg_fcn) {
--- a/src/ov-cell.cc +++ b/src/ov-cell.cc @@ -28,6 +28,8 @@ #include <iostream> #include <vector> +#include "Array-util.h" +#include "byte-swap.h" #include "lo-sstream.h" #include "lo-utils.h" #include "quit.h" @@ -42,9 +44,9 @@ #include "ov-base-mat.cc" #include "ov-re-mat.h" #include "ov-scalar.h" -#include "Array-util.h" +#include "pr-output.h" +#include "ov-scalar.h" -#include "byte-swap.h" #include "ls-oct-ascii.h" #include "ls-oct-binary.h" #include "ls-hdf5.h" @@ -402,7 +404,7 @@ else { os << "{}"; - if (nr > 0 || nc > 0) + if (Vprint_empty_dimensions) os << "(" << nr << "x" << nc << ")"; os << "\n"; }
--- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -70,9 +70,9 @@ // routines. static int Voutput_precision; -// TRUE means that the dimensions of empty matrices should be printed +// TRUE means that the dimensions of empty objects should be printed // like this: x = [](2x0). -static bool Vprint_empty_dimensions; +bool Vprint_empty_dimensions; // TRUE means that the rows of big matrices should be split into // smaller slices that fit on the screen.