# HG changeset patch # User jwe # Date 780159836 0 # Node ID 02814aea28c8f20ad9920d2be594c69316125d77 # Parent e81d3a66725e6494391f5182ee0d975f968aebc8 [project @ 1994-09-21 15:01:30 by jwe] diff --git a/src/data.cc b/src/data.cc --- a/src/data.cc +++ b/src/data.cc @@ -117,7 +117,7 @@ int y_nr = y.rows (); int y_nc = y.columns (); - assert (x_nr == x_nc && y_nr == y_nc); + assert (x_nr == y_nr && x_nc == y_nc); Matrix retval (x_nr, x_nc); @@ -149,15 +149,11 @@ int arg_y_empty = empty_arg ("atan2", y_nr, y_nc); int arg_x_empty = empty_arg ("atan2", x_nr, x_nc); - if (arg_y_empty < 0 || arg_x_empty < 0) + if (arg_y_empty > 0 && arg_x_empty > 0) + return Matrix (); + else if (arg_y_empty || arg_x_empty) return retval; - if (arg_y_empty || arg_x_empty) - { - retval = Matrix (); - return retval; - } - int y_is_scalar = (y_nr == 1 && y_nc == 1); int x_is_scalar = (x_nr == 1 && x_nc == 1); diff --git a/src/pr-output.cc b/src/pr-output.cc --- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -878,8 +878,7 @@ } void -octave_print_internal (ostream& os, double d, - int pr_as_read_syntax) +octave_print_internal (ostream& os, double d, int pr_as_read_syntax) { if (plus_format) { @@ -902,8 +901,7 @@ } void -octave_print_internal (ostream& os, const Matrix& m, - int pr_as_read_syntax) +octave_print_internal (ostream& os, const Matrix& m, int pr_as_read_syntax) { int nr = m.rows (); int nc = m.columns (); diff --git a/src/utils.cc b/src/utils.cc --- a/src/utils.cc +++ b/src/utils.cc @@ -522,6 +522,9 @@ return argv; } +// Return non-zero if either NR or NC is zero. Return -1 if this +// should be considered fatal; return 1 if this is ok. + int empty_arg (const char *name, int nr, int nc) { @@ -541,6 +544,8 @@ gripe_empty_arg (name, 1); is_empty = -1; } + else + is_empty = 1; } return is_empty;