Mercurial > hg > octave-lyh
changeset 7299:df2c3977b0bf
[project @ 2007-12-11 22:06:49 by jwe]
author | jwe |
---|---|
date | Tue, 11 Dec 2007 22:06:49 +0000 |
parents | d42d8c43d3e7 |
children | 11c781ef004a |
files | liboctave/ChangeLog liboctave/Sparse.cc |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2007-12-11 John W. Eaton <jwe@octave.org> + + * Sparse.cc (Sparse<T>::index (idx_vector&, int) const): + If indexing scalar with empty matrix, return empty array with same + size as index. + 2007-12-10 John W. Eaton <jwe@octave.org> * NLEqn.h (NLEqn::fval): New data member. Adjust constructors
--- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -1517,7 +1517,7 @@ if (idx_arg.one_zero_only ()) retval = Sparse<T> (dim_vector (0, 0)); else - retval = Sparse<T> (dim_vector (0, 1)); + retval = Sparse<T> (idx_orig_dims); else if (nz < 1) if (n >= idx_orig_dims.numel ()) retval = Sparse<T> (idx_orig_dims);