# HG changeset patch # User Jaroslav Hajek # Date 1270634826 -7200 # Node ID 2f8bacc2a57d78ae343fa045cb7254ee8a9818b7 # Parent a6b64a7a37693c30f92e93c13a957b5e6ccb41e8 fix order of func defs in Sparse.cc diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,7 @@ +2010-04-07 Jaroslav Hajek + + * Sparse.cc (lblookup): Move in front of Sparse::delete_elements. + 2010-04-07 Jaroslav Hajek * str-vec.h (string_vector::string_vector (const Array)): diff --git a/liboctave/Sparse.cc b/liboctave/Sparse.cc --- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -1217,6 +1217,25 @@ } } +// Lower bound lookup. Could also use octave_sort, but that has upper bound +// semantics, so requires some manipulation to set right. Uses a plain loop for +// small columns. +static octave_idx_type +lblookup (const octave_idx_type *ridx, octave_idx_type nr, + octave_idx_type ri) +{ + if (nr <= 8) + { + octave_idx_type l; + for (l = 0; l < nr; l++) + if (ridx[l] >= ri) + break; + return l; + } + else + return std::lower_bound (ridx, ridx + nr, ri) - ridx; +} + template void Sparse::delete_elements (const idx_vector& idx) @@ -1429,25 +1448,6 @@ return retval; } -// Lower bound lookup. Could also use octave_sort, but that has upper bound -// semantics, so requires some manipulation to set right. Uses a plain loop for -// small columns. -static octave_idx_type -lblookup (const octave_idx_type *ridx, octave_idx_type nr, - octave_idx_type ri) -{ - if (nr <= 8) - { - octave_idx_type l; - for (l = 0; l < nr; l++) - if (ridx[l] >= ri) - break; - return l; - } - else - return std::lower_bound (ridx, ridx + nr, ri) - ridx; -} - template Sparse Sparse::index (const idx_vector& idx, bool resize_ok) const