Mercurial > hg > octave-max
changeset 9026:6890d411a0b8
adjust some array dim query methods
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 26 Mar 2009 13:05:03 +0100 |
parents | 484756d558d6 |
children | 9a46ba093db4 |
files | liboctave/Array.h liboctave/ChangeLog |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -255,7 +255,8 @@ size_t byte_size (void) const { return numel () * sizeof (T); } - dim_vector dims (void) const { return dimensions; } + // Return a const-reference so that dims ()(i) works efficiently. + const dim_vector& dims (void) const { return dimensions; } Array<T> squeeze (void) const; @@ -428,6 +429,8 @@ bool is_empty (void) const { return numel () == 0; } + bool is_vector (void) const { return dimensions.is_vector (); } + Array<T> transpose (void) const; Array<T> hermitian (T (*fcn) (const T&) = 0) const;