Mercurial > hg > octave-terminal
changeset 9177:39be2c4531c8
fix sparse indexing bug
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 05 May 2009 15:18:55 +0200 |
parents | 7ea76c8a59f7 |
children | a6375c37dad4 |
files | liboctave/ChangeLog liboctave/Sparse.cc |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,7 @@ +2009-05-05 Jaroslav Hajek <highegg@gmail.com> + + * Sparse.cc (assign1): Fix an old indexing bug. + 2009-05-04 Carsten Clark <tantumquantum+gnuoctave@gmail.com> * Quad.cc (float_user_function): Remove Sun/GCC special case.
--- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -2715,13 +2715,17 @@ i++; while (ii < nc && c_lhs.cidx(ii+1) <= i) ii++; + tmp.xridx (kk++) = 0; } else { while (ic <= jj) tmp.xcidx (ic++) = kk; if (scalar_non_zero) - tmp.xdata (kk) = scalar; + { + tmp.xdata (kk) = scalar; + tmp.xridx (kk++) = 0; + } if (ii == jj) { i++; @@ -2732,7 +2736,6 @@ if (j < n) jj = lhs_idx.elem(j); } - tmp.xridx (kk++) = 0; } for (octave_idx_type iidx = ic; iidx < max_idx+1; iidx++)