diff liboctave/Array.h @ 9878:ead4f9c82a9a

implement Array<T>::nnz
author Jaroslav Hajek <highegg@gmail.com>
date Fri, 27 Nov 2009 09:10:21 +0100
parents c0b54271904b
children 7c8392a034e6
line wrap: on
line diff
--- a/liboctave/Array.h	Thu Nov 26 21:31:35 2009 +0100
+++ b/liboctave/Array.h	Fri Nov 27 09:10:21 2009 +0100
@@ -641,6 +641,9 @@
   // This looks up only exact matches, returning true/false if match.
   Array<bool> lookupb (const Array<T>& values, sortmode mode = UNSORTED) const;
 
+  // Count nonzero elements.
+  octave_idx_type nnz (void) 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;