Mercurial > hg > octave-terminal
changeset 10652:2f0fbfa4dd23
simplify octave_base_value::ndims
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 25 May 2010 08:24:29 +0200 |
parents | 944b78191f03 |
children | ec5fa46e0e45 |
files | src/ChangeLog src/ov-base.cc src/ov-base.h |
diffstat | 3 files changed, 9 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2010-05-25 Jaroslav Hajek <highegg@gmail.com> + + * ov-base.cc (octave_base_value::ndims): Remove fallback + implementation (makes no sense). + * ov-base.h (octave_base_value::ndims): Use a simplistic fallback + here. + 2010-05-25 Jaroslav Hajek <highegg@gmail.com> * ov-base.h (octave_base_value::rows, octave_base_value::columns):
--- a/src/ov-base.cc +++ b/src/ov-base.cc @@ -203,31 +203,6 @@ return idx_vector (); } -int -octave_base_value::ndims (void) const -{ - dim_vector dv = dims (); - - int n_dims = dv.length (); - - // Remove trailing singleton dimensions. - - for (int i = n_dims; i > 2; i--) - { - if (dv(i-1) == 1) - n_dims--; - else - break; - } - - // The result is always >= 2. - - if (n_dims < 2) - n_dims = 2; - - return n_dims; -} - octave_value octave_base_value::subsasgn (const std::string& type, const std::list<octave_value_list>& idx,