Mercurial > hg > octave-nkf
diff liboctave/Array-util.cc @ 4887:bbddd4339cf2
[project @ 2004-04-30 17:08:55 by jwe]
author | jwe |
---|---|
date | Fri, 30 Apr 2004 17:08:55 +0000 |
parents | 3f28979bbe2c |
children | 100f9c190be4 |
line wrap: on
line diff
--- a/liboctave/Array-util.cc +++ b/liboctave/Array-util.cc @@ -422,28 +422,24 @@ else { int last_ra_idx = ra_idx(n-1)(0); + for (int i = 1; i < ra_idx (n - 1).capacity (); i++) + last_ra_idx = (last_ra_idx > ra_idx(n-1)(i) ? last_ra_idx : + ra_idx(n-1)(i)); - if (last_ra_idx < dimensions(n - 1)) + if (last_ra_idx < size_left) { - retval(n - 1) = ra_idx(n - 1).freeze (dimensions(n-1), - "dimension", resize_ok); + retval(n-1) = ra_idx(n-1).freeze (size_left, + "dimension", resize_ok); } else { - if (size_left <= last_ra_idx) - { - // Make it larger than it should be to get an error - // later. - - retval.resize(n_dims + 1); + // Make it larger than it should be to get an error + // later. - (*current_liboctave_error_handler) - ("index exceeds N-d array dimensions"); - } - else - { - retval(n-1) = 1; - } + retval.resize (n_dims+1); + + (*current_liboctave_error_handler) + ("index exceeds N-d array dimensions"); } } }