Mercurial > hg > octave-avbm
changeset 4740:65f30438c2a3
[project @ 2004-02-05 19:58:57 by jwe]
author | jwe |
---|---|
date | Thu, 05 Feb 2004 19:58:57 +0000 |
parents | 7bd3748e2735 |
children | e44d0ac643a5 |
files | liboctave/Array.cc liboctave/ChangeLog |
diffstat | 2 files changed, 15 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -1413,11 +1413,9 @@ dim_vector lhs_dims = dims (); - dim_vector idx_is_colon; - idx_is_colon.resize (n_idx); - - dim_vector idx_is_colon_equiv; - idx_is_colon_equiv.resize (n_idx); + Array<int> idx_is_colon (n_idx, 0); + + Array<int> idx_is_colon_equiv (n_idx, 0); // Initialization of colon arrays. @@ -2710,15 +2708,13 @@ dim_vector new_dims; new_dims.resize (lhs_dims.length ()); - for (int i = 0; i < lhs_dims.length (); i++) - { - if (i < idx.length () - 1 - && idx(i).elem (0) + 1 > lhs_dims(i)) - new_dims(i) = idx(i).elem (0)+1; - else - new_dims(i) = lhs_dims(i); - } - + for (int i = 0; i < idx.length () - 1; i++) + new_dims(i) = idx(i).elem (0) >= lhs_dims(i) + ? idx(i).elem (0) + 1 : lhs_dims (i); + + for (int i = idx.length (); i < lhs_dims.length (); i++) + new_dims(i) = lhs_dims (i); + lhs.resize (new_dims, rfv); lhs_dims = lhs.dims ();
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,5 +1,10 @@ 2004-02-05 Petter Risholm <risholm@stud.ntnu.no> + * Array.cc (Array<T>::maybe_delete_elements): Declare idx_is_colon + and idx_is_colon_equiv Array<int> instead of dim_vector. + + * Array.cc (Array<T>::assignN): Compute new dims in a cleaner way. + * Array.cc (Array<T>::index): Check for frozen_lengths.length () == n_dims before checking to see if all indices are colon_equiv.