Mercurial > octave-dspies
changeset 12318:211f8c905a4f
sparse matrix indexed assignment bug
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 31 Jan 2011 17:09:24 -0500 |
parents | 126d8fe48a12 |
children | e7c8ce0c0d3e |
files | liboctave/ChangeLog liboctave/Sparse.cc |
diffstat | 2 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog Mon Jan 31 16:41:43 2011 -0500 +++ b/liboctave/ChangeLog Mon Jan 31 17:09:24 2011 -0500 @@ -1,3 +1,9 @@ +2011-01-31 John W. Eaton <jwe@octave.org> + + * Sparse.cc (Sparse<T>::assign (const idx_vector&, const idx_vector&, + const Sparse<T>&)): Handle case of LHS originally empty, and + with non-colon indices. Fix typo in previous change. Bug #32263. + 2011-01-30 Pascal Dupuis <Pascal.Dupuis@worldonline.be> * lo-sysdep.cc (opendir): On error, free allocated DIR object
--- a/liboctave/Sparse.cc Mon Jan 31 16:41:43 2011 -0500 +++ b/liboctave/Sparse.cc Mon Jan 31 17:09:24 2011 -0500 @@ -1875,7 +1875,7 @@ nrx = n; if (idx_j.is_colon ()) - ncx = n; + ncx = m; else ncx = idx_j.extent (nc); } @@ -1884,6 +1884,11 @@ nrx = idx_i.extent (nr); ncx = m; } + else + { + nrx = idx_i.extent (nr); + ncx = idx_j.extent (nc); + } } else {