Mercurial > hg > octave-nkf
changeset 4630:ca70857bdbd1
[project @ 2003-11-18 18:18:16 by jwe]
author | jwe |
---|---|
date | Tue, 18 Nov 2003 18:20:11 +0000 |
parents | ed92d574b55b |
children | cae0b7c46842 |
files | liboctave/ChangeLog liboctave/Makefile.in scripts/ChangeLog scripts/general/issymmetric.m src/ChangeLog src/ov-base-mat.cc src/ov-bool.h src/ov-scalar.h |
diffstat | 8 files changed, 39 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,7 @@ +2003-11-18 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makefile.in (TEMPLATE_SRC): Move MArrayN.cc here from MATRIX_SRC. + 2003-11-15 John W. Eaton <jwe@bevo.che.wisc.edu> * Array.h (Array<T>::resize (int, const T&)): Reinstate.
--- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -67,7 +67,7 @@ $(VX_OP_INC) TEMPLATE_SRC := Array.cc ArrayN.cc DiagArray2.cc \ - MArray.cc MArray2.cc MDiagArray2.cc base-lu.cc + MArray.cc MArray2.cc MArrayN.cc MDiagArray2.cc base-lu.cc TI_SRC := Array-C.cc Array-b.cc Array-ch.cc Array-i.cc Array-d.cc \ Array-s.cc Array-str.cc Array-idx-vec.cc \ @@ -77,7 +77,7 @@ CDiagMatrix.cc CMatrix.cc CNDArray.cc CRowVector.cc \ CmplxAEPBAL.cc CmplxCHOL.cc CmplxDET.cc CmplxHESS.cc \ CmplxLU.cc CmplxQR.cc CmplxQRP.cc CmplxSCHUR.cc CmplxSVD.cc \ - EIG.cc MArray-misc.cc MArrayN.cc boolMatrix.cc \ + EIG.cc MArray-misc.cc boolMatrix.cc \ boolNDArray.cc chMatrix.cc chNDArray.cc dColVector.cc \ dDiagMatrix.cc dMatrix.cc dNDArray.cc dRowVector.cc \ dbleAEPBAL.cc dbleCHOL.cc dbleDET.cc dbleHESS.cc dbleLU.cc \
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2003-11-18 John W. Eaton <jwe@bevo.che.wisc.edu> + + * general/issymmetric.m: Don't fail if norm (x) == 0. + 2003-11-17 John W. Eaton <jwe@bevo.che.wisc.edu> * miscellaneous/path.m: Fix thinko in previous change.
--- a/scripts/general/issymmetric.m +++ b/scripts/general/issymmetric.m @@ -38,7 +38,8 @@ if (nargin == 1) tol = eps; endif - if (norm (x - x') / norm(x) > tol) + norm_x = norm (x); + if (norm_x != 0 && norm (x - x') / norm_x > tol) retval = 0; endif endif
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2003-11-18 John W. Eaton <jwe@bevo.che.wisc.edu> + + * ov-bool.h (octave_bool::array_value, + octave_bool::complex_array_value): New functions. + + * ov-base-mat.cc (octave_base_matrix<MT>::do_index_op): + Ensure correct number of indices for Array indexing code. + 2003-11-17 John W. Eaton <jwe@bevo.che.wisc.edu> * DLD-FUNCTIONS/qz.cc (qz): Use x.data()+offset instead of &a(i,j).
--- a/src/ov-base-mat.cc +++ b/src/ov-base-mat.cc @@ -127,10 +127,18 @@ { case 2: { - idx_vector i = idx (0).index_vector (); - idx_vector j = idx (1).index_vector (); + int nd = matrix.ndims (); - retval = MT (matrix.index (i, j, resize_ok, MT::resize_fill_value ())); + if (nd == 2) + { + idx_vector i = idx (0).index_vector (); + idx_vector j = idx (1).index_vector (); + + retval = MT (matrix.index (i, j, resize_ok, MT::resize_fill_value ())); + } + else + error ("invalid number of indices (= 2) for %d-dimensional array", + nd); } break;
--- a/src/ov-bool.h +++ b/src/ov-bool.h @@ -92,11 +92,17 @@ Matrix matrix_value (bool = false) const { return Matrix (1, 1, scalar); } + NDArray array_value (bool = false) const + { return NDArray (dim_vector (1, 1), scalar); } + Complex complex_value (bool = false) const { return scalar; } ComplexMatrix complex_matrix_value (bool = false) const { return ComplexMatrix (1, 1, Complex (scalar)); } + ComplexNDArray complex_array_value (bool = false) const + { return ComplexNDArray (dim_vector (1, 1), Complex (scalar)); } + bool bool_value (void) const { return scalar; } boolMatrix bool_matrix_value (void) const
--- a/src/ov-scalar.h +++ b/src/ov-scalar.h @@ -90,7 +90,7 @@ { return Matrix (1, 1, scalar); } NDArray array_value (bool = false) const - { return NDArray (dim_vector (1, 1), double_value ()); } + { return NDArray (dim_vector (1, 1), scalar); } Complex complex_value (bool = false) const { return scalar; } @@ -98,7 +98,7 @@ { return ComplexMatrix (1, 1, Complex (scalar)); } ComplexNDArray complex_array_value (bool = false) const - { return ComplexNDArray (dim_vector (1, 1), double_value ()); } + { return ComplexNDArray (dim_vector (1, 1), Complex (scalar)); } octave_value convert_to_str_internal (bool pad, bool force) const;