Mercurial > hg > octave-terminal
changeset 2601:3723512a827a
[project @ 1997-01-06 05:43:16 by jwe]
author | jwe |
---|---|
date | Mon, 06 Jan 1997 05:44:24 +0000 |
parents | c454cd888ada |
children | 9cbbbcf5b6f5 |
files | PROJECTS README.Linux WWW/mailing-lists/index.html liboctave/ChangeLog liboctave/dMatrix.cc scripts/ChangeLog scripts/elfun/gcd.m scripts/elfun/lcm.m src/ChangeLog src/Makefile.in src/oct-stream.cc src/op-cm-cm.cc src/op-cm-cs.cc src/op-cm-m.cc src/op-cm-s.cc src/op-cs-cm.cc src/op-cs-m.cc src/op-m-cm.cc src/op-m-cs.cc src/op-m-m.cc src/op-m-s.cc src/op-s-cm.cc src/op-s-m.cc src/op-str-str.cc src/ops.h src/pr-output.cc src/pt-fcn.cc |
diffstat | 27 files changed, 222 insertions(+), 139 deletions(-) [+] |
line wrap: on
line diff
--- a/PROJECTS +++ b/PROJECTS @@ -210,6 +210,19 @@ Interpreter: ----------- + * Fix the parser so that + + function foo () + implicit_str_to_num_ok = 1; + '#' + 0; + endfunction + + succeeds, even when implicit_str_to_num_ok is 0 at the time the + function is parsed. + + * Consider making x(:) work no matter what the value of + do_fortran_indexing. + * If foo.oct and foo.m both exist in the LOADPATH, Octave will always find foo.oct, even if foo.m appears earlier in the list of directories. This should be fixed (in the kpathsearch library) to
--- a/README.Linux +++ b/README.Linux @@ -93,6 +93,12 @@ should keep gcc from adding -lieee to the link command. You can find the location of the specs file by running the command gcc -v. +If you can't edit the gcc specs file for some reason, another solution +that should work is to create an empty libieee.a file in the Octave +src directory using the command: + + ar cq libieee.a + My system doesn't have g77 -------------------------- @@ -121,6 +127,11 @@ and they must be compatible. You should get and read the release notes for the compiler and libraries. +If you decide to install versions of the libraries that are older (or +newer) than the ones you already have, you should follow the +directions in the release notes very carefully. + + If you have comments or suggestions for this document, please contact bug-octave@bevo.che.wisc.edu.
--- a/WWW/mailing-lists/index.html +++ b/WWW/mailing-lists/index.html @@ -14,6 +14,7 @@ <p> <ul> +<li><a href="help-octave/1997">1997</a> <li><a href="help-octave/1996">1996</a> <li><a href="help-octave/1995">1995</a> <li><a href="help-octave/1994">1994</a> @@ -28,6 +29,7 @@ <p> <ul> +<li><a href="bug-octave/1997">1997</a> <li><a href="bug-octave/1996">1996</a> <li><a href="bug-octave/1995">1995</a> <li><a href="bug-octave/1994">1994</a> @@ -42,6 +44,7 @@ <p> <ul> +<li><a href="octave-sources/1997">1997</a> <li><a href="octave-sources/1996">1996</a> </ul> </p>
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +Sun Jan 5 12:07:45 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + + * dMatrix.cc (Matrix::read): Correctly compute the number of + columns for resizing when the number of rows is specified but the + number of columns is not. + Wed Dec 18 16:18:58 1996 John W. Eaton <jwe@bevo.che.wisc.edu> * Range.cc (operator -): New function.
--- a/liboctave/dMatrix.cc +++ b/liboctave/dMatrix.cc @@ -2888,7 +2888,7 @@ max_size *= 2; if (nr > 0) - resize (nr, max_size / 2, 0.0); + resize (nr, max_size / nr, 0.0); else resize (max_size, 1, 0.0);
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,10 @@ +Thu Dec 19 22:16:46 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + + * elfun/lcm.m: Replace missing if statement. + + * elfun/gcd.m: Report error if no input args. + * elfun/lcm.m: Likewise. + Mon Dec 16 15:23:04 1996 John W. Eaton <jwe@bevo.che.wisc.edu> * Makefile.in (install): Use ls -LR to create ls-R database.
--- a/scripts/elfun/gcd.m +++ b/scripts/elfun/gcd.m @@ -31,6 +31,10 @@ function [g, v] = gcd (a, ...) + if (nargin == 0) + usage ("[g, v] = gcd (a, ...)"); + endif + if (nargin > 1) va_start; for k = 2:nargin;
--- a/scripts/elfun/lcm.m +++ b/scripts/elfun/lcm.m @@ -29,6 +29,11 @@ function l = lcm (a, ...) + if (nargin == 0) + usage ("lcm (a, ...)"); + endif + + if (nargin > 1) va_start; for k = 2:nargin; a = [a, (va_arg ())];
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,26 @@ +Sun Jan 5 12:50:25 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + + * ops.h (SC_MX_BOOL_OP, MX_SC_BOOL_OP): New arg, empty_result. + * op-cm-cm.cc, op-cm-cs.cc, op-cm-m.cc, op-cm-s.cc, op-cs-cm.cc, + op-cs-m.cc, op-m-cm.cc, op-m-cs.cc, op-m-m.cc, op-m-s.cc, + op-s-cm.cc, op-s-m.cc, op-str-str.cc: Change all uses of + SC_MX_BOOL_OP and MX_SC_BOOL_OP macros. Return correct results + for empty matrix cases. + + * pt-fcn.cc (tree_function::eval): If Vdefine_all_return_values is + true, initialize return values before evaluating function, for + compatibility with Matlab. + + * oct-stream.cc (get_size): Correctly set size when arg is scalar. + +Thu Jan 2 12:40:10 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makefile.in (install-oct): Quote $(OCT_FILES) in for loop to + avoid syntax error from ksh. + + * pr-output.cc (octave_print_internal): Avoid unused parameter + warning from gcc. + Thu Dec 19 12:13:42 1996 John W. Eaton <jwe@bevo.che.wisc.edu> * oct-stream.cc (octave_base_stream::do_scanf):
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -261,7 +261,7 @@ if [ -n "$(OCT_FILES)" ]; then \ $(top_srcdir)/mkinstalldirs $(octfiledir) ; \ chmod a+rx mk-oct-links ; \ - for f in $(OCT_FILES); do \ + for f in "$(OCT_FILES)"; do \ $(INSTALL_PROGRAM) $$f $(octfiledir)/$$f; \ done ; \ ./mk-oct-links $(octfiledir) $(addprefix $(srcdir)/, $(DLD_SRC)) ; \
--- a/src/oct-stream.cc +++ b/src/oct-stream.cc @@ -112,22 +112,30 @@ double dnr = -1.0; double dnc = -1.0; - if (size.rows () == 1 && size.cols () > 0) + int sz_nr = size.rows (); + int sz_nc = size.cols (); + + if (sz_nr == 1 && sz_nc == 1) + { + dnr = size (0, 0); + dnc = 1.0; + } + else if (sz_nr == 1 && sz_nc > 0) { dnr = size (0, 0); - if (size.cols () == 2) + if (sz_nc == 2) dnc = size (0, 1); - else if (size.cols () > 2) + else if (sz_nc > 2) ::error ("%s: invalid size specification", warn_for); } - else if (size.cols () == 1 && size.rows () > 0) + else if (sz_nc == 1 && sz_nr > 0) { dnr = size (0, 0); - if (size.rows () == 2) + if (sz_nr == 2) dnc = size (1, 0); - else if (size.rows () > 2) + else if (sz_nr > 2) ::error ("%s: invalid size specification", warn_for); } else
--- a/src/op-cm-cm.cc +++ b/src/op-cm-cm.cc @@ -99,7 +99,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_complex_matrix&); - BOOL_OP (<, 0.0); + BOOL_OP (<, Matrix ()); } static octave_value @@ -107,7 +107,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_complex_matrix&); - BOOL_OP (<=, 0.0); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -117,7 +117,7 @@ MX_MX_BOOL_OP (ComplexMatrix, m1, v1.complex_matrix_value (), \ ComplexMatrix, m2, v2.complex_matrix_value (), \ - m1 (i, j) == m2 (i, j), "==", 1.0); + m1 (i, j) == m2 (i, j), "==", 0.0); } static octave_value @@ -125,7 +125,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_complex_matrix&); - BOOL_OP (>=, 0.0); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -133,7 +133,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_complex_matrix&); - BOOL_OP (>, 0.0); + BOOL_OP (>, Matrix ()); } static octave_value @@ -143,7 +143,7 @@ MX_MX_BOOL_OP (ComplexMatrix, m1, v1.complex_matrix_value (), \ ComplexMatrix, m2, v2.complex_matrix_value (), \ - m1 (i, j) != m2 (i, j), "!=", 0.0); + m1 (i, j) != m2 (i, j), "!=", 1.0); } static octave_value @@ -188,7 +188,7 @@ MX_MX_BOOL_OP (ComplexMatrix, m1, v1.complex_matrix_value (), \ ComplexMatrix, m2, v2.complex_matrix_value (), \ - m1 (i, j) != 0.0 && m2 (i, j) != 0.0, "&", 0.0); + m1 (i, j) != 0.0 && m2 (i, j) != 0.0, "&", Matrix ()); } static octave_value @@ -198,7 +198,7 @@ MX_MX_BOOL_OP (ComplexMatrix, m1, v1.complex_matrix_value (), \ ComplexMatrix, m2, v2.complex_matrix_value (), \ - m1 (i, j) != 0.0 || m2 (i, j) != 0.0, "|", 0.0); + m1 (i, j) != 0.0 || m2 (i, j) != 0.0, "|", Matrix ()); } static octave_value
--- a/src/op-cm-cs.cc +++ b/src/op-cm-cs.cc @@ -92,17 +92,17 @@ return octave_value (); } -#define BOOL_OP(OP) \ +#define BOOL_OP(OP, EMPTY_RESULT) \ MX_SC_BOOL_OP (ComplexMatrix, m, v1.complex_matrix_value (), \ Complex, s, v2.complex_value (), \ - real (m (i, j)) OP real (s)) + real (m (i, j)) OP real (s), EMPTY_RESULT) static octave_value lt (const octave_value& a1, const octave_value& a2) { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_complex&); - BOOL_OP (<); + BOOL_OP (<, Matrix ()); } static octave_value @@ -110,7 +110,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_complex&); - BOOL_OP (<=); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -120,7 +120,7 @@ MX_SC_BOOL_OP (ComplexMatrix, m, v1.complex_matrix_value (), \ Complex, s, v2.complex_value (), \ - m (i, j) == s); + m (i, j) == s, 0.0); } static octave_value @@ -128,7 +128,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_complex&); - BOOL_OP (>=); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -136,7 +136,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_complex&); - BOOL_OP (>); + BOOL_OP (>, Matrix ()); } static octave_value @@ -146,7 +146,7 @@ MX_SC_BOOL_OP (ComplexMatrix, m, v1.complex_matrix_value (), \ Complex, s, v2.complex_value (), \ - m (i, j) != s); + m (i, j) != s, 1.0); } static octave_value @@ -193,7 +193,7 @@ MX_SC_BOOL_OP (ComplexMatrix, m, v1.complex_matrix_value (), \ Complex, s, v2.complex_value (), \ - m (i, j) != 0.0 && s != 0.0); + m (i, j) != 0.0 && s != 0.0, Matrix ()); } static octave_value @@ -203,7 +203,7 @@ MX_SC_BOOL_OP (ComplexMatrix, m, v1.complex_matrix_value (), \ Complex, s, v2.complex_value (), \ - m (i, j) != 0.0 || s != 0.0); + m (i, j) != 0.0 || s != 0.0, Matrix ()); } static octave_value
--- a/src/op-cm-m.cc +++ b/src/op-cm-m.cc @@ -97,7 +97,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_matrix&); - BOOL_OP (<, 0.0); + BOOL_OP (<, Matrix ()); } static octave_value @@ -105,7 +105,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_matrix&); - BOOL_OP (<=, 0.0); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -115,7 +115,7 @@ MX_MX_BOOL_OP (ComplexMatrix, m1, v1.complex_matrix_value (), \ Matrix, m2, v2.matrix_value (), \ - m1 (i, j) == m2 (i, j), "==", 1.0); + m1 (i, j) == m2 (i, j), "==", 0.0); } static octave_value @@ -123,7 +123,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_matrix&); - BOOL_OP (>=, 0.0); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -131,7 +131,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_matrix&); - BOOL_OP (>, 0.0); + BOOL_OP (>, Matrix ()); } static octave_value @@ -183,7 +183,7 @@ MX_MX_BOOL_OP (ComplexMatrix, m1, v1.complex_matrix_value (), \ Matrix, m2, v2.matrix_value (), \ - m1 (i, j) != 0.0 && m2 (i, j), "&", 0.0); + m1 (i, j) != 0.0 && m2 (i, j), "&", Matrix ()); } static octave_value @@ -193,7 +193,7 @@ MX_MX_BOOL_OP (ComplexMatrix, m1, v1.complex_matrix_value (), \ Matrix, m2, v2.matrix_value (), \ - m1 (i, j) != 0.0 || m2 (i, j), "|", 0.0); + m1 (i, j) != 0.0 || m2 (i, j), "|", Matrix ()); } static octave_value
--- a/src/op-cm-s.cc +++ b/src/op-cm-s.cc @@ -92,17 +92,17 @@ return octave_value (); } -#define BOOL_OP(OP) \ +#define BOOL_OP(OP, EMPTY_RESULT) \ MX_SC_BOOL_OP (ComplexMatrix, m, v1.complex_matrix_value (), \ double, s, v2.double_value (), \ - real (m (i, j)) OP s) + real (m (i, j)) OP s, EMPTY_RESULT) static octave_value lt (const octave_value& a1, const octave_value& a2) { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_scalar&); - BOOL_OP (<); + BOOL_OP (<, Matrix ()); } static octave_value @@ -110,7 +110,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_scalar&); - BOOL_OP (<=); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -120,7 +120,7 @@ MX_SC_BOOL_OP (ComplexMatrix, m, v1.complex_matrix_value (), \ double, s, v2.double_value (), \ - m (i, j) == s); + m (i, j) == s, 0.0); } static octave_value @@ -128,7 +128,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_scalar&); - BOOL_OP (>=); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -136,7 +136,7 @@ { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_scalar&); - BOOL_OP (>); + BOOL_OP (>, Matrix ()); } static octave_value @@ -146,7 +146,7 @@ MX_SC_BOOL_OP (ComplexMatrix, m, v1.complex_matrix_value (), \ double, s, v2.double_value (), \ - m (i, j) != s); + m (i, j) != s, 1.0); } static octave_value @@ -193,7 +193,7 @@ MX_SC_BOOL_OP (ComplexMatrix, m, v1.complex_matrix_value (), \ double, s, v2.double_value (), \ - m (i, j) != 0.0 && s); + m (i, j) != 0.0 && s, Matrix ()); } static octave_value @@ -203,7 +203,7 @@ MX_SC_BOOL_OP (ComplexMatrix, m, v1.complex_matrix_value (), \ double, s, v2.double_value (), \ - m (i, j) != 0.0 || s); + m (i, j) != 0.0 || s, Matrix ()); } static octave_value
--- a/src/op-cs-cm.cc +++ b/src/op-cs-cm.cc @@ -92,17 +92,17 @@ return octave_value (v2.complex_matrix_value () / d); } -#define BOOL_OP(OP) \ +#define BOOL_OP(OP, EMPTY_RESULT) \ SC_MX_BOOL_OP (Complex, s, v1.complex_value (), \ ComplexMatrix, m, v2.complex_matrix_value (), \ - real (s) OP real (m (i, j))) + real (s) OP real (m (i, j)), EMPTY_RESULT) static octave_value lt (const octave_value& a1, const octave_value& a2) { CAST_BINOP_ARGS (const octave_complex&, const octave_complex_matrix&); - BOOL_OP (<); + BOOL_OP (<, Matrix ()); } static octave_value @@ -110,7 +110,7 @@ { CAST_BINOP_ARGS (const octave_complex&, const octave_complex_matrix&); - BOOL_OP (<=); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -120,7 +120,7 @@ SC_MX_BOOL_OP (Complex, s, v1.complex_value (), \ ComplexMatrix, m, v2.complex_matrix_value (), \ - s == m (i, j)); + s == m (i, j), 0.0); } static octave_value @@ -128,7 +128,7 @@ { CAST_BINOP_ARGS (const octave_complex&, const octave_complex_matrix&); - BOOL_OP (>=); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -136,7 +136,7 @@ { CAST_BINOP_ARGS (const octave_complex&, const octave_complex_matrix&); - BOOL_OP (>); + BOOL_OP (>, Matrix ()); } static octave_value @@ -146,7 +146,7 @@ SC_MX_BOOL_OP (Complex, s, v1.complex_value (), \ ComplexMatrix, m, v2.complex_matrix_value (), \ - s != m (i, j)); + s != m (i, j), 1.0); } static octave_value @@ -193,7 +193,7 @@ SC_MX_BOOL_OP (Complex, s, v1.complex_value (), \ ComplexMatrix, m, v2.complex_matrix_value (), \ - s != 0.0 && m (i, j) != 0.0); + s != 0.0 && m (i, j) != 0.0, Matrix ()); } static octave_value @@ -203,7 +203,7 @@ SC_MX_BOOL_OP (Complex, s, v1.complex_value (), \ ComplexMatrix, m, v2.complex_matrix_value (), \ - s != 0.0 || m (i, j) != 0.0); + s != 0.0 || m (i, j) != 0.0, Matrix ()); } static octave_value *
--- a/src/op-cs-m.cc +++ b/src/op-cs-m.cc @@ -93,17 +93,17 @@ return octave_value (v2.matrix_value () / d); } -#define BOOL_OP(OP) \ +#define BOOL_OP(OP, EMPTY_RESULT) \ SC_MX_BOOL_OP (Complex, s, v1.complex_value (), \ Matrix, m, v2.matrix_value (), \ - real (s) OP m (i, j)) + real (s) OP m (i, j), EMPTY_RESULT) static octave_value lt (const octave_value& a1, const octave_value& a2) { CAST_BINOP_ARGS (const octave_complex&, const octave_matrix&); - BOOL_OP (<); + BOOL_OP (<, Matrix ()); } static octave_value @@ -111,7 +111,7 @@ { CAST_BINOP_ARGS (const octave_complex&, const octave_matrix&); - BOOL_OP (<=); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -121,7 +121,7 @@ SC_MX_BOOL_OP (Complex, s, v1.complex_value (), \ Matrix, m, v2.matrix_value (), \ - s == m (i, j)); + s == m (i, j), 0.0); } static octave_value @@ -129,7 +129,7 @@ { CAST_BINOP_ARGS (const octave_complex&, const octave_matrix&); - BOOL_OP (>=); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -137,7 +137,7 @@ { CAST_BINOP_ARGS (const octave_complex&, const octave_matrix&); - BOOL_OP (>); + BOOL_OP (>, Matrix ()); } static octave_value @@ -147,7 +147,7 @@ SC_MX_BOOL_OP (Complex, s, v1.complex_value (), \ Matrix, m, v2.matrix_value (), \ - s != m (i, j)); + s != m (i, j), 1.0); } static octave_value @@ -194,7 +194,7 @@ SC_MX_BOOL_OP (Complex, s, v1.complex_value (), \ Matrix, m, v2.matrix_value (), \ - s != 0.0 && m (i, j)); + s != 0.0 && m (i, j), Matrix ()); } static octave_value @@ -204,7 +204,7 @@ SC_MX_BOOL_OP (Complex, s, v1.complex_value (), \ Matrix, m, v2.matrix_value (), \ - s != 0.0 || m (i, j)); + s != 0.0 || m (i, j), Matrix ()); } static octave_value *
--- a/src/op-m-cm.cc +++ b/src/op-m-cm.cc @@ -97,7 +97,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_complex_matrix&); - BOOL_OP (<, 0.0); + BOOL_OP (<, Matrix ()); } static octave_value @@ -105,7 +105,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_complex_matrix&); - BOOL_OP (<=, 0.0); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -115,7 +115,7 @@ MX_MX_BOOL_OP (Matrix, m1, v1.matrix_value (), \ ComplexMatrix, m2, v2.complex_matrix_value (), \ - m1 (i, j) == m2 (i, j), "==", 1.0); + m1 (i, j) == m2 (i, j), "==", 0.0); } static octave_value @@ -123,7 +123,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_complex_matrix&); - BOOL_OP (>=, 0.0); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -131,7 +131,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_complex_matrix&); - BOOL_OP (>, 0.0); + BOOL_OP (>, Matrix ()); } static octave_value @@ -141,7 +141,7 @@ MX_MX_BOOL_OP (Matrix, m1, v1.matrix_value (), \ ComplexMatrix, m2, v2.complex_matrix_value (), \ - m1 (i, j) != m2 (i, j), "!=", 0.0); + m1 (i, j) != m2 (i, j), "!=", 1.0); } static octave_value @@ -183,7 +183,7 @@ MX_MX_BOOL_OP (Matrix, m1, v1.matrix_value (), \ ComplexMatrix, m2, v2.complex_matrix_value (), \ - m1 (i, j) && m2 (i, j) != 0.0, "&", 0.0); + m1 (i, j) && m2 (i, j) != 0.0, "&", Matrix ()); } static octave_value @@ -193,7 +193,7 @@ MX_MX_BOOL_OP (Matrix, m1, v1.matrix_value (), \ ComplexMatrix, m2, v2.complex_matrix_value (), \ - m1 (i, j) || m2 (i, j) != 0.0, "|", 0.0); + m1 (i, j) || m2 (i, j) != 0.0, "|", Matrix ()); } static octave_value *
--- a/src/op-m-cs.cc +++ b/src/op-m-cs.cc @@ -93,17 +93,17 @@ return octave_value (); } -#define BOOL_OP(OP) \ +#define BOOL_OP(OP, EMPTY_RESULT) \ MX_SC_BOOL_OP (Matrix, m, v1.matrix_value (), \ Complex, s, v2.complex_value (), \ - m (i, j) OP real (s)) + m (i, j) OP real (s), EMPTY_RESULT) static octave_value lt (const octave_value& a1, const octave_value& a2) { CAST_BINOP_ARGS (const octave_matrix&, const octave_complex&); - BOOL_OP (<); + BOOL_OP (<, Matrix ()); } static octave_value @@ -111,7 +111,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_complex&); - BOOL_OP (<=); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -121,7 +121,7 @@ MX_SC_BOOL_OP (Matrix, m, v1.matrix_value (), \ Complex, s, v2.complex_value (), \ - m (i, j) == s); + m (i, j) == s, 0.0); } static octave_value @@ -129,7 +129,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_complex&); - BOOL_OP (>=); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -137,7 +137,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_complex&); - BOOL_OP (>); + BOOL_OP (>, Matrix ()); } static octave_value @@ -147,7 +147,7 @@ MX_SC_BOOL_OP (Matrix, m, v1.matrix_value (), \ Complex, s, v2.complex_value (), \ - m (i, j) != s); + m (i, j) != s, 1.0); } static octave_value @@ -194,7 +194,7 @@ MX_SC_BOOL_OP (Matrix, m, v1.matrix_value (), \ Complex, s, v2.complex_value (), \ - m (i, j) && s != 0.0); + m (i, j) && s != 0.0, Matrix ()); } static octave_value @@ -204,7 +204,7 @@ MX_SC_BOOL_OP (Matrix, m, v1.matrix_value (), \ Complex, s, v2.complex_value (), \ - m (i, j) || s != 0.0); + m (i, j) || s != 0.0, Matrix ()); } static octave_value *
--- a/src/op-m-m.cc +++ b/src/op-m-m.cc @@ -96,7 +96,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_matrix&); - BOOL_OP (<, 0.0); + BOOL_OP (<, Matrix ()); } static octave_value @@ -104,7 +104,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_matrix&); - BOOL_OP (<=, 0.0); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -120,7 +120,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_matrix&); - BOOL_OP (>=, 0.0); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -128,7 +128,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_matrix&); - BOOL_OP (>, 0.0); + BOOL_OP (>, Matrix ()); } static octave_value @@ -178,7 +178,7 @@ MX_MX_BOOL_OP (Matrix, m1, v1.matrix_value (), \ Matrix, m2, v2.matrix_value (), \ - m1 (i, j) && m2 (i, j), "&", 0.0); + m1 (i, j) && m2 (i, j), "&", Matrix ()); } static octave_value @@ -188,7 +188,7 @@ MX_MX_BOOL_OP (Matrix, m1, v1.matrix_value (), \ Matrix, m2, v2.matrix_value (), \ - m1 (i, j) || m2 (i, j), "|", 0.0); + m1 (i, j) || m2 (i, j), "|", Matrix ()); } static octave_value
--- a/src/op-m-s.cc +++ b/src/op-m-s.cc @@ -92,17 +92,17 @@ return octave_value (); } -#define BOOL_OP(OP) \ +#define BOOL_OP(OP, EMPTY_RESULT) \ MX_SC_BOOL_OP (Matrix, m, v1.matrix_value (), \ double, s, v2.double_value (), \ - m (i, j) OP s) + m (i, j) OP s, EMPTY_RESULT) static octave_value lt (const octave_value& a1, const octave_value& a2) { CAST_BINOP_ARGS (const octave_matrix&, const octave_scalar&); - BOOL_OP (<); + BOOL_OP (<, Matrix ()); } static octave_value @@ -110,7 +110,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_scalar&); - BOOL_OP (<=); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -118,7 +118,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_scalar&); - BOOL_OP (==); + BOOL_OP (==, 0.0); } static octave_value @@ -126,7 +126,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_scalar&); - BOOL_OP (>=); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -134,7 +134,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_scalar&); - BOOL_OP (>); + BOOL_OP (>, Matrix ()); } static octave_value @@ -142,7 +142,7 @@ { CAST_BINOP_ARGS (const octave_matrix&, const octave_scalar&); - BOOL_OP (!=); + BOOL_OP (!=, 1.0); } static octave_value @@ -189,7 +189,7 @@ MX_SC_BOOL_OP (Matrix, m, v1.matrix_value (), \ double, s, v2.double_value (), \ - m (i, j) && s); + m (i, j) && s, Matrix ()); } static octave_value @@ -199,7 +199,7 @@ MX_SC_BOOL_OP (Matrix, m, v1.matrix_value (), \ double, s, v2.double_value (), \ - m (i, j) || s); + m (i, j) || s, Matrix ()); } static octave_value
--- a/src/op-s-cm.cc +++ b/src/op-s-cm.cc @@ -92,17 +92,17 @@ return octave_value (v2.complex_matrix_value () / d); } -#define BOOL_OP(OP) \ +#define BOOL_OP(OP, EMPTY_RESULT) \ SC_MX_BOOL_OP (double, s, v1.double_value (), \ ComplexMatrix, m, v2.complex_matrix_value (), \ - s OP real (m (i, j))) + s OP real (m (i, j)), EMPTY_RESULT) static octave_value lt (const octave_value& a1, const octave_value& a2) { CAST_BINOP_ARGS (const octave_scalar&, const octave_complex_matrix&); - BOOL_OP (<); + BOOL_OP (<, Matrix ()); } static octave_value @@ -110,7 +110,7 @@ { CAST_BINOP_ARGS (const octave_scalar&, const octave_complex_matrix&); - BOOL_OP (<=); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -120,7 +120,7 @@ SC_MX_BOOL_OP (double, s, v1.double_value (), \ ComplexMatrix, m, v2.complex_matrix_value (), \ - s == m (i, j)); + s == m (i, j), 0.0); } static octave_value @@ -128,7 +128,7 @@ { CAST_BINOP_ARGS (const octave_scalar&, const octave_complex_matrix&); - BOOL_OP (>=); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -136,7 +136,7 @@ { CAST_BINOP_ARGS (const octave_scalar&, const octave_complex_matrix&); - BOOL_OP (>); + BOOL_OP (>, Matrix ()); } static octave_value @@ -146,7 +146,7 @@ SC_MX_BOOL_OP (double, s, v1.double_value (), \ ComplexMatrix, m, v2.complex_matrix_value (), \ - s != m (i, j)); + s != m (i, j), 1.0); } static octave_value @@ -193,7 +193,7 @@ SC_MX_BOOL_OP (double, s, v1.double_value (), \ ComplexMatrix, m, v2.complex_matrix_value (), \ - s && m (i, j) != 0.0); + s && m (i, j) != 0.0, Matrix ()); } static octave_value @@ -203,7 +203,7 @@ SC_MX_BOOL_OP (double, s, v1.double_value (), \ ComplexMatrix, m, v2.complex_matrix_value (), \ - s || m (i, j) != 0.0); + s || m (i, j) != 0.0, Matrix ()); } static octave_value *
--- a/src/op-s-m.cc +++ b/src/op-s-m.cc @@ -92,17 +92,17 @@ return octave_value (v2.matrix_value () / d); } -#define BOOL_OP(OP) \ +#define BOOL_OP(OP, EMPTY_RESULT) \ SC_MX_BOOL_OP (double, s, v1.double_value (), \ Matrix, m, v2.matrix_value (), \ - s OP m (i, j)) + s OP m (i, j), EMPTY_RESULT) static octave_value lt (const octave_value& a1, const octave_value& a2) { CAST_BINOP_ARGS (const octave_scalar&, const octave_matrix&); - BOOL_OP (<); + BOOL_OP (<, Matrix ()); } static octave_value @@ -110,7 +110,7 @@ { CAST_BINOP_ARGS (const octave_scalar&, const octave_matrix&); - BOOL_OP (<=); + BOOL_OP (<=, Matrix ()); } static octave_value @@ -118,7 +118,7 @@ { CAST_BINOP_ARGS (const octave_scalar&, const octave_matrix&); - BOOL_OP (==); + BOOL_OP (==, 0.0); } static octave_value @@ -126,7 +126,7 @@ { CAST_BINOP_ARGS (const octave_scalar&, const octave_matrix&); - BOOL_OP (>=); + BOOL_OP (>=, Matrix ()); } static octave_value @@ -134,7 +134,7 @@ { CAST_BINOP_ARGS (const octave_scalar&, const octave_matrix&); - BOOL_OP (>); + BOOL_OP (>, Matrix ()); } static octave_value @@ -142,7 +142,7 @@ { CAST_BINOP_ARGS (const octave_scalar&, const octave_matrix&); - BOOL_OP (!=); + BOOL_OP (!=, 1.0); } static octave_value @@ -189,7 +189,7 @@ SC_MX_BOOL_OP (double, s, v1.double_value (), \ Matrix, m, v2.matrix_value (), \ - s && m (i, j)); + s && m (i, j), Matrix ()); } static octave_value @@ -199,7 +199,7 @@ SC_MX_BOOL_OP (double, s, v1.double_value (), \ Matrix, m, v2.matrix_value (), \ - s || m (i, j)); + s || m (i, j), Matrix ()); } static octave_value *
--- a/src/op-str-str.cc +++ b/src/op-str-str.cc @@ -52,19 +52,19 @@ else SC_MX_BOOL_OP (char, c, cm1 (0, 0), \ charMatrix, m, cm2, \ - c == m (i, j)); + c == m (i, j), 0.0); } else { if (cm2.rows () == 1 && cm2.columns () == 1) MX_SC_BOOL_OP (charMatrix, m, cm1, \ char, c, cm2 (0, 0), \ - c == m (i, j)); + c == m (i, j), 0.0); else MX_MX_BOOL_OP (charMatrix, m1, cm1, \ charMatrix, m2, cm2, \ m1 (i, j) == m2 (i, j), \ - "==", 1.0); + "==", 0.0); } } @@ -84,14 +84,14 @@ else SC_MX_BOOL_OP (char, c, cm1 (0, 0), \ charMatrix, m, cm2, \ - c != m (i, j)); + c != m (i, j), 1.0); } else { if (cm2.rows () == 1 && cm2.columns () == 1) MX_SC_BOOL_OP (charMatrix, m, cm1, \ char, c, cm2 (0, 0), \ - c != m (i, j)); + c != m (i, j), 1.0); else MX_MX_BOOL_OP (charMatrix, m1, cm1, \ charMatrix, m2, cm2, \
--- a/src/ops.h +++ b/src/ops.h @@ -60,20 +60,24 @@ retval (i, j) = test; \ return retval; -#define SC_MX_BOOL_OP(st, sn, get_s, mt, mn, get_m, test) \ +#define SC_MX_BOOL_OP(st, sn, get_s, mt, mn, get_m, test, empty_result) \ do \ { \ BOOL_OP1 (st, sn, get_s, mt, mn, get_m) \ BOOL_OP2 (mn) \ + if (nr == 0|| nc == 0) \ + return empty_result; \ BOOL_OP3 (test) \ } \ while (0) -#define MX_SC_BOOL_OP(mt, mn, get_m, st, sn, get_s, test) \ +#define MX_SC_BOOL_OP(mt, mn, get_m, st, sn, get_s, test, empty_result) \ do \ { \ BOOL_OP1 (mt, mn, get_m, st, sn, get_s) \ BOOL_OP2 (mn) \ + if (nr == 0|| nc == 0) \ + return empty_result; \ BOOL_OP3 (test) \ } \ while (0) @@ -83,10 +87,10 @@ do \ { \ BOOL_OP1 (m1t, m1n, get_m1, m2t, m2n, get_m2) \ - int m1_nr = m1.rows (); \ - int m1_nc = m1.cols (); \ - int m2_nr = m2.rows (); \ - int m2_nc = m2.cols (); \ + int m1_nr = m1n.rows (); \ + int m1_nc = m1n.cols (); \ + int m2_nr = m2n.rows (); \ + int m2_nc = m2n.cols (); \ if (m1_nr != m2_nr || m1_nc != m2_nc) \ { \ gripe_nonconformant ("operator " op, m1_nr, m1_nc, m2_nr, m2_nc); \
--- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -1480,7 +1480,7 @@ void octave_print_internal (ostream& os, const charMatrix& chm, bool pr_as_read_syntax, bool pr_as_string, - int extra_indent) + int /* extra_indent XXX FIXME XXX */) { if (pr_as_string) {
--- a/src/pt-fcn.cc +++ b/src/pt-fcn.cc @@ -315,6 +315,14 @@ goto abort; } + if (ret_list && Vdefine_all_return_values) + { + octave_value tmp = builtin_any_variable ("default_return_value"); + + if (tmp.is_defined ()) + ret_list->initialize_undefined_elements (tmp); + } + // The following code is in a separate scope to avoid warnings from // G++ about `goto abort' crossing the initialization of some // variables. @@ -350,16 +358,7 @@ // Copy return values out. if (ret_list) - { - if (nargout > 0 && Vdefine_all_return_values) - { - octave_value tmp = builtin_any_variable ("default_return_value"); - if (tmp.is_defined ()) - ret_list->initialize_undefined_elements (tmp); - } - - retval = ret_list->convert_to_const_vector (vr_list); - } + retval = ret_list->convert_to_const_vector (vr_list); else if (Vreturn_last_computed_value) retval(0) = last_computed_value; }