Mercurial > hg > octave-lyh
diff liboctave/dim-vector.h @ 4673:6639c2574023
[project @ 2003-12-10 16:11:54 by jwe]
author | jwe |
---|---|
date | Wed, 10 Dec 2003 16:11:54 +0000 |
parents | c8829691db47 |
children | 24c7bc6354ba |
line wrap: on
line diff
--- a/liboctave/dim-vector.h +++ b/liboctave/dim-vector.h @@ -111,6 +111,17 @@ return dims[i]; } + void chop_trailing_singletons (void) + { + for (int i = ndims - 1; i > 1; i--) + { + if (dims[i] == 1) + ndims--; + else + break; + } + } + private: // No assignment! @@ -200,7 +211,6 @@ } } - std::string str (char sep = 'x') const { OSSTREAM buf; @@ -287,6 +297,12 @@ return retval; } + + void chop_trailing_singletons (void) + { + make_unique (); + rep->chop_trailing_singletons (); + } }; static inline bool