Mercurial > hg > octave-nkf
diff liboctave/Array.h @ 9341:9fd5c56ce57a
extend lookup capabilities
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 12 Jun 2009 16:01:53 +0200 |
parents | 472f0e22aa60 |
children | 1beb23d2b892 |
line wrap: on
line diff
--- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -582,6 +582,13 @@ Array<octave_idx_type> lookup (const Array<T>& values, sortmode mode = UNSORTED, bool linf = false, bool rinf = false) const; + // This looks up only exact matches, giving their indices. Non-exact matches get + // the value -1. + Array<octave_idx_type> lookupm (const Array<T>& values, sortmode mode = UNSORTED) const; + + // This looks up only exact matches, returning true/false if match. + Array<bool> lookupb (const Array<T>& values, sortmode mode = UNSORTED) const; + // Find indices of (at most n) nonzero elements. If n is specified, backward // specifies search from backward. Array<octave_idx_type> find (octave_idx_type n = -1, bool backward = false) const;