Mercurial > hg > octave-lyh
changeset 719:02814aea28c8
[project @ 1994-09-21 15:01:30 by jwe]
author | jwe |
---|---|
date | Wed, 21 Sep 1994 15:03:56 +0000 |
parents | e81d3a66725e |
children | 43fc5a13be23 |
files | src/data.cc src/pr-output.cc src/utils.cc |
diffstat | 3 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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 ();
--- 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;