diff liboctave/Array.h @ 9025:484756d558d6

add Array<T>::find
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 26 Mar 2009 13:05:00 +0100
parents a48fba01e4ac
children 6890d411a0b8
line wrap: on
line diff
--- a/liboctave/Array.h
+++ b/liboctave/Array.h
@@ -579,6 +579,10 @@
   Array<octave_idx_type> lookup (const Array<T>& values, sortmode mode = UNSORTED, 
                                  bool linf = false, bool rinf = false) 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;
+
   Array<T> diag (octave_idx_type k = 0) const;
 
   template <class U, class F>