Mercurial > octave
changeset 21509:dcee67d28570
doc: doxygen documentation for dim_vector::ndims and dim_vector::length.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Fri, 29 May 2015 00:25:46 +0100 |
parents | 04923b7b0d89 |
children | ddfd7e5f8d18 |
files | liboctave/array/dim-vector.h |
diffstat | 1 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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); }