Mercurial > hg > octave-terminal
changeset 2563:8b0911d576bf
[project @ 1996-12-05 19:06:58 by jwe]
author | jwe |
---|---|
date | Thu, 05 Dec 1996 19:06:59 +0000 |
parents | 0c978e147a3a |
children | ac70da7eeedc |
files | liboctave/CMatrix.cc liboctave/ChangeLog src/ChangeLog src/op-str-str.cc src/qzval.cc |
diffstat | 5 files changed, 66 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/CMatrix.cc +++ b/liboctave/CMatrix.cc @@ -1416,7 +1416,9 @@ int len_s = m < n ? m : n; Array<double> s (len_s); double *ps = s.fortran_vec (); + double rcond = -1.0; + int lwork; if (m < n) lwork = 2*m + (nrhs > n ? nrhs : n); @@ -1439,7 +1441,7 @@ (*current_liboctave_error_handler) ("unrecoverable error in zgelss"); else { - ComplexMatrix retval (n, nrhs); + retval.resize (n, nrhs); for (int j = 0; j < nrhs; j++) for (int i = 0; i < n; i++) retval.elem (i, j) = result.elem (i, j); @@ -1519,7 +1521,7 @@ (*current_liboctave_error_handler) ("unrecoverable error in zgelss"); else { - ComplexColumnVector retval (n); + retval.resize (n); for (int i = 0; i < n; i++) retval.elem (i) = result.elem (i); }
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,7 @@ +Thu Dec 5 13:05:18 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + + * CMatrix.cc (lssolve): Don't redeclare retval, resize it. + Wed Dec 4 12:24:24 1996 John W. Eaton <jwe@bevo.che.wisc.edu> * dMatrix.cc (Qzval): Don't try to use same memory three times.
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +Tue Dec 3 23:47:09 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + + * op-str-str.cc (eq, ne): Handle operations with scalars. + Thu Nov 21 12:30:36 1996 John W. Eaton <jwe@bevo.che.wisc.edu> * ov-str-mat.h (octave_char_matrix_str): Provide transpose and
--- a/src/op-str-str.cc +++ b/src/op-str-str.cc @@ -42,7 +42,30 @@ CAST_BINOP_ARGS (const octave_char_matrix_str&, const octave_char_matrix_str&); - return octave_value (v1.char_matrix_value () == v2.char_matrix_value ()); + charMatrix cm1 = v1.char_matrix_value (); + charMatrix cm2 = v2.char_matrix_value (); + + if (cm1.rows () == 1 && cm1.columns () == 1) + { + if (cm2.rows () == 1 && cm2.columns () == 1) + return octave_value (cm1 (0, 0) == cm2 (0, 0)); + else + SC_MX_BOOL_OP (char, c, cm1 (0, 0), \ + charMatrix, m, cm2, \ + c == m (i, j)); + } + else + { + if (cm2.rows () == 1 && cm2.columns () == 1) + MX_SC_BOOL_OP (charMatrix, m, cm1, \ + char, c, cm2 (0, 0), \ + c == m (i, j)); + else + MX_MX_BOOL_OP (charMatrix, m1, cm1, \ + charMatrix, m2, cm2, \ + m1 (i, j) == m2 (i, j), \ + "==", 1.0); + } } static octave_value @@ -51,7 +74,30 @@ CAST_BINOP_ARGS (const octave_char_matrix_str&, const octave_char_matrix_str&); - return octave_value (v1.char_matrix_value () != v2.char_matrix_value ()); + charMatrix cm1 = v1.char_matrix_value (); + charMatrix cm2 = v2.char_matrix_value (); + + if (cm1.rows () == 1 && cm1.columns () == 1) + { + if (cm2.rows () == 1 && cm2.columns () == 1) + return octave_value (cm1 (0, 0) != cm2 (0, 0)); + else + SC_MX_BOOL_OP (char, c, cm1 (0, 0), \ + charMatrix, m, cm2, \ + c != m (i, j)); + } + else + { + if (cm2.rows () == 1 && cm2.columns () == 1) + MX_SC_BOOL_OP (charMatrix, m, cm1, \ + char, c, cm2 (0, 0), \ + c != m (i, j)); + else + MX_MX_BOOL_OP (charMatrix, m1, cm1, \ + charMatrix, m2, cm2, \ + m1 (i, j) != m2 (i, j), \ + "!=", 1.0); + } } static octave_value