Mercurial > hg > octave-lojdl
changeset 7238:22f210ca8cc1
[project @ 2007-12-03 20:10:01 by dbateman]
author | dbateman |
---|---|
date | Mon, 03 Dec 2007 20:10:01 +0000 |
parents | 7e248dd1e6d5 |
children | 7d7f05863f27 |
files | liboctave/ChangeLog liboctave/Sparse.cc |
diffstat | 2 files changed, 14 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2007-12-03 David Bateman <dbateman@free.fr> + + * Sparse.cc (template <class LT, class RT> int assign + (Sparse<LT>&, const Sparse<RT>&)): Only set return matrix size to + rhs values if both no. rows and columns are zero. + 2007-11-30 John W. Eaton <jwe@octave.org> * oct-sort.cc, oct-sort.h: Style fixes.
--- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -2471,11 +2471,14 @@ int idx_i_is_colon = idx_i.is_colon (); int idx_j_is_colon = idx_j.is_colon (); - if (idx_i_is_colon) - n = lhs_nr > 0 ? lhs_nr : rhs_nr; - - if (idx_j_is_colon) - m = lhs_nc > 0 ? lhs_nc : rhs_nc; + if (lhs_nr == 0 && lhs_nc == 0) + { + if (idx_i_is_colon) + n = rhs_nr; + + if (idx_j_is_colon) + m = rhs_nc; + } if (idx_i && idx_j) {