Mercurial > hg > octave-terminal
changeset 15358:b135f013679e
maint: periodic merge of stable to default
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 11 Sep 2012 16:41:17 -0400 |
parents | b6b261c3eab3 (current diff) 4663cc835c65 (diff) |
children | d6ea3c0f80d8 |
files | liboctave/array/Sparse.cc |
diffstat | 1 files changed, 14 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/array/Sparse.cc +++ b/liboctave/array/Sparse.cc @@ -323,9 +323,10 @@ if (n == 1 && a(0) != T ()) { change_capacity (nzm > 1 ? nzm : 1); - xcidx (0) = 0; - xridx (0) = r(0); - xdata (0) = a(0); + xcidx(0) = 0; + xridx(0) = r(0); + xdata(0) = a(0); + for (octave_idx_type j = 0; j < nc; j++) xcidx (j+1) = j >= c(0); } @@ -495,8 +496,8 @@ new_nz += rd[i-1] != rd[i]; // Allocate result. change_capacity (nzm > new_nz ? nzm : new_nz); - xcidx (0) = 0; - xcidx (1) = new_nz; + xcidx(0) = 0; + xcidx(1) = new_nz; octave_idx_type *rri = ridx (); T *rrd = data (); @@ -1253,7 +1254,7 @@ else { const Sparse<T> tmp = *this; - octave_idx_type lbi = tmp.cidx (lb), ubi = tmp.cidx (ub), + octave_idx_type lbi = tmp.cidx(lb), ubi = tmp.cidx(ub), new_nz = nz - (ubi - lbi); *this = Sparse<T> (nr, nc - (ub - lb), new_nz); @@ -1296,20 +1297,20 @@ tmpl.nnz () + tmpu.nnz ()); for (octave_idx_type j = 0, k = 0; j < nc; j++) { - for (octave_idx_type i = tmpl.cidx (j); i < tmpl.cidx (j+1); + for (octave_idx_type i = tmpl.cidx(j); i < tmpl.cidx(j+1); i++) { - xdata (k) = tmpl.data (i); - xridx (k++) = tmpl.ridx (i); + xdata(k) = tmpl.data(i); + xridx(k++) = tmpl.ridx(i); } - for (octave_idx_type i = tmpu.cidx (j); i < tmpu.cidx (j+1); + for (octave_idx_type i = tmpu.cidx(j); i < tmpu.cidx(j+1); i++) { - xdata (k) = tmpu.data (i); - xridx (k++) = tmpu.ridx (i) + lb; + xdata(k) = tmpu.data(i); + xridx(k++) = tmpu.ridx(i) + lb; } - xcidx (j+1) = k; + xcidx(j+1) = k; } } }