Mercurial > hg > octave-nkf
changeset 4737:108c9a93196d
[project @ 2004-02-05 18:25:00 by jwe]
author | jwe |
---|---|
date | Thu, 05 Feb 2004 18:25:00 +0000 |
parents | 4179c59d82da |
children | c9e5b9fa7b17 |
files | liboctave/Array.cc liboctave/ChangeLog |
diffstat | 2 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -2025,6 +2025,21 @@ int n_dims = dimensions.length (); + // Remove trailing singletons in ra_idx, but leave at least ndims + // elements. + + int ra_idx_len = ra_idx.length (); + + while (ra_idx_len > n_dims) + { + if (ra_idx(ra_idx_len-1) == 1) + ra_idx_len--; + else + break; + } + + ra_idx.resize (ra_idx_len); + if (n_dims < ra_idx.length ()) { (*current_liboctave_error_handler)