# HG changeset patch # User Carnë Draug # Date 1432855546 -3600 # Node ID dcee67d28570c02a73060618c992244f4b882030 # Parent 04923b7b0d896a0b56e52cb5bb7c0fab19ca70d6 doc: doxygen documentation for dim_vector::ndims and dim_vector::length. diff -r 04923b7b0d89 -r dcee67d28570 liboctave/array/dim-vector.h --- a/liboctave/array/dim-vector.h Sat Mar 19 19:43:55 2016 +0000 +++ b/liboctave/array/dim-vector.h Fri May 29 00:25:46 2015 +0100 @@ -93,8 +93,6 @@ octave_idx_type *rep; - octave_idx_type& ndims (void) const { return rep[-1]; } - octave_idx_type& count (void) const { return rep[-2]; } //! Construct a new rep with count = 1 and ndims given. @@ -322,6 +320,21 @@ freerep (); } + //! Number of dimensions. + /*! + Returns the number of dimensions of the dim_vector. This is number of + elements in the dim_vector including trailing singetons. It is also + the number of dimensions an Array with this dim_vector would have. + */ + octave_idx_type& ndims (void) const { return rep[-1]; } + + //! Number of dimensions. + //! Synonymous with ndims(). + /*! + While this method is not officially deprecated, consider using ndims() + instead to avoid confusion. Array does not have length because of its + odd definition as length of the longest dimension. + */ int length (void) const { return ndims (); } octave_idx_type& operator () (int i) { return elem (i); }