Mercurial > hg > octave-lyh
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 +++ b/liboctave/Array.h @@ -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;