# HG changeset patch # User John W. Eaton # Date 1296511764 18000 # Node ID 1c4cad056b7981471ea3d82b137522c58b3affd5 # Parent a85d14454adc9585963dbbe300943bf0f0b48bfb sparse matrix indexed assignment bug diff -r a85d14454adc -r 1c4cad056b79 liboctave/ChangeLog --- 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 + + * Sparse.cc (Sparse::assign (const idx_vector&, const idx_vector&, + const Sparse&)): Handle case of LHS originally empty, and + with non-colon indices. Fix typo in previous change. Bug #32263. + 2011-01-30 Pascal Dupuis * lo-sysdep.cc (opendir): On error, free allocated DIR object diff -r a85d14454adc -r 1c4cad056b79 liboctave/Sparse.cc --- 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 {