Mercurial > hg > octave-nkf
changeset 20422:6af35d4f1ba4 stable
doxygen: document Array::length() and similar methods (bug #45138)
* liboctave/array/Array.h: make special note that Array::length() is different
from length() at the Octave interpreter. Also document capacity, nelem, and
numel.
author | Piotr Held <pjheld@gmail.com> |
---|---|
date | Wed, 20 May 2015 10:15:20 -0600 |
parents | eae5e4d58740 |
children | ca2da088eada |
files | liboctave/array/Array.h |
diffstat | 1 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/array/Array.h +++ b/liboctave/array/Array.h @@ -249,11 +249,29 @@ void clear (octave_idx_type r, octave_idx_type c) { clear (dim_vector (r, c)); } + // Number of elements in the array. These are all synonyms. //@{ - //! Number of elements in the array. These are all synonyms. + //! Number of elements in the array. + //! Synonymous with length(), nelem(), and numel(). octave_idx_type capacity (void) const { return slice_len; } + + //! Number of elements in the array. + /*! Synonymous with capacity(), nelem(), and numel(). + + @note + This is @em not the same as @c %length() at the Octave interpreter. + At the Octave interpreter, the function @c %length() returns the + length of the greatest dimension. This method returns the total + number of elements. + */ octave_idx_type length (void) const { return capacity (); } + + //! Number of elements in the array. + //! Synonymous with capacity(), length(), and numel(). octave_idx_type nelem (void) const { return capacity (); } + + //! Number of elements in the array. + //! Synonymous with capacity(), length(), and nelem(). octave_idx_type numel (void) const { return nelem (); } //@}