Mercurial > hg > octave-lojdl
changeset 8180:da48d2ca096f
small fixes in oct-lookup.h
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 06 Oct 2008 14:02:36 +0200 |
parents | 6c08e3921d3e |
children | 1ebcb9872ced |
files | liboctave/ChangeLog liboctave/oct-lookup.h |
diffstat | 2 files changed, 13 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,7 @@ +2008-10-06 Jaroslav Hajek <highegg@gmail.com> + + * oct-lookup.h: Mark functions inline. Add missing std:: qualifiers. + 2008-10-03 Jaroslav Hajek <highegg@gmail.com> * Array.h (Array<T>::maybe_delete_elements): Remove rfv argument from
--- a/liboctave/oct-lookup.h +++ b/liboctave/oct-lookup.h @@ -32,7 +32,7 @@ // a simple binary lookup template<typename T, typename bpred> -octave_idx_type +inline octave_idx_type bin_lookup (const T *table, octave_idx_type size, const T& val, bpred comp) @@ -42,7 +42,7 @@ // version using < operator template<typename T> -octave_idx_type +inline octave_idx_type bin_lookup (const T *table, octave_idx_type size, const T& val) { @@ -72,14 +72,14 @@ // bind2nd (less<T>(), a), // not1 (bind2nd (less<T>(), b))) template<class T, class bpred> -out_range<T, bpred> +inline out_range<T, bpred> chk_out_range (const T& a, const T& b, bpred comp) { return out_range<T, bpred> (a, b, comp); } template<typename T, typename bpred> -void +inline void seq_lookup (const T *table, octave_idx_type offset, octave_idx_type size, const T *vals, octave_idx_type nvals, octave_idx_type *idx, bpred comp) @@ -125,11 +125,11 @@ else // special case: lowermost range (-Inf, min) vnew = std::find_if (vcur, vend, - not1 (bind2nd (comp, *cur))); + std::not1 (std::bind2nd (comp, *cur))); else // special case: uppermost range [max, Inf) vnew = std::find_if (vcur, vend, - bind2nd (comp, *(cur-1))); + std::bind2nd (comp, *(cur-1))); // store index of the current interval. std::fill_n (idx, vnew - vcur, cur - table); @@ -142,7 +142,7 @@ // overload using < operator template<typename T, typename bpred> -void +inline void seq_lookup (const T *table, octave_idx_type offset, octave_idx_type size, const T *vals, octave_idx_type nvals, octave_idx_type *idx) @@ -152,14 +152,14 @@ // helper functions - determine whether an array is descending template<typename T> -bool +inline bool is_descending (const T *table, octave_idx_type size) { return size > 1 && table[size-1] < table[0]; } template<typename T, typename bpred> -bool +inline bool is_descending (const T *table, octave_idx_type size, bpred comp) {