Mercurial > hg > octave-max
changeset 8505:124dd27bedae
Array.cc: style fixes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 13 Jan 2009 10:59:12 -0500 |
parents | 0e0bd07e6ae2 |
children | bc982528de11 |
files | liboctave/Array.cc |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -1916,6 +1916,7 @@ octave_idx_type ns = dv(dim); octave_idx_type iter = dv.numel () / ns; octave_idx_type stride = 1; + for (int i = 0; i < dim; i++) stride *= dv(i); @@ -1943,13 +1944,15 @@ for (octave_idx_type j = 0; j < iter; j++) { - octave_idx_type offset = j; - octave_idx_type offset2 = 0; + octave_idx_type offset = j; + octave_idx_type offset2 = 0; + while (offset >= stride) { offset -= stride; offset2++; } + offset += offset2 * stride * ns; for (octave_idx_type i = 0; i < ns; i++) @@ -1983,6 +1986,7 @@ octave_idx_type ns = dv(dim); octave_idx_type iter = dv.numel () / ns; octave_idx_type stride = 1; + for (int i = 0; i < dim; i++) stride *= dv(i); @@ -2032,11 +2036,13 @@ { octave_idx_type offset = j; octave_idx_type offset2 = 0; + while (offset >= stride) { offset -= stride; offset2++; } + offset += offset2 * stride * ns; for (octave_idx_type i = 0; i < ns; i++)