Mercurial > octave
diff src/DLD-FUNCTIONS/find.cc @ 14854:5ae9f0f77635
maint: Use Octave coding conventions for coddling parenthis is DLD-FUNCTIONS directory
* __fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc, __magick_read__.cc,
besselj.cc, bsxfun.cc, ccolamd.cc, cellfun.cc, chol.cc, colamd.cc, daspk.cc,
dasrt.cc, dassl.cc, dmperm.cc, fft.cc, filter.cc, find.cc, gcd.cc, kron.cc,
lsode.cc, lu.cc, luinc.cc, quad.cc, quadcc.cc, rand.cc, regexp.cc, schur.cc,
str2double.cc, symbfact.cc, symrcm.cc, tril.cc, urlwrite.cc: Use Octave coding
conventions for coddling parenthis is DLD-FUNCTIONS directory.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Mon, 09 Jul 2012 13:01:49 -0700 |
parents | 460a3c6d8bf1 |
children |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/find.cc Mon Jul 09 10:34:43 2012 -0700 +++ b/src/DLD-FUNCTIONS/find.cc Mon Jul 09 13:01:49 2012 -0700 @@ -111,9 +111,9 @@ for (octave_idx_type j = 0; j < nc; j++) { OCTAVE_QUIT; - if (v.cidx(j) == 0 && v.cidx(j+1) != 0) + if (v.cidx (j) == 0 && v.cidx (j+1) != 0) start_nc = j; - if (v.cidx(j+1) >= n_to_find) + if (v.cidx (j+1) >= n_to_find) { end_nc = j + 1; break; @@ -125,9 +125,9 @@ for (octave_idx_type j = nc; j > 0; j--) { OCTAVE_QUIT; - if (v.cidx(j) == nz && v.cidx(j-1) != nz) + if (v.cidx (j) == nz && v.cidx (j-1) != nz) end_nc = j; - if (nz - v.cidx(j-1) >= n_to_find) + if (nz - v.cidx (j-1) >= n_to_find) { start_nc = j - 1; break; @@ -135,8 +135,8 @@ } } - count = (n_to_find > v.cidx(end_nc) - v.cidx(start_nc) ? - v.cidx(end_nc) - v.cidx(start_nc) : n_to_find); + count = (n_to_find > v.cidx (end_nc) - v.cidx (start_nc) ? + v.cidx (end_nc) - v.cidx (start_nc) : n_to_find); // If the original argument was a row vector, force a row vector of // the overall indices to be returned. But see below for scalar @@ -168,14 +168,14 @@ // there are elements to be found using the count that we want // to find. for (octave_idx_type j = start_nc, cx = 0; j < end_nc; j++) - for (octave_idx_type i = v.cidx(j); i < v.cidx(j+1); i++ ) + for (octave_idx_type i = v.cidx (j); i < v.cidx (j+1); i++ ) { OCTAVE_QUIT; if (direction < 0 && i < nz - count) continue; - i_idx(cx) = static_cast<double> (v.ridx(i) + 1); + i_idx(cx) = static_cast<double> (v.ridx (i) + 1); j_idx(cx) = static_cast<double> (j + 1); - idx(cx) = j * nr + v.ridx(i) + 1; + idx(cx) = j * nr + v.ridx (i) + 1; val(cx) = v.data(i); cx++; if (cx == count)