Mercurial > octave-nkf
diff liboctave/Array.cc @ 4733:80156474b068
[project @ 2004-02-04 18:40:03 by jwe]
author | jwe |
---|---|
date | Wed, 04 Feb 2004 18:40:03 +0000 |
parents | fe25e290fafb |
children | 24c7bc6354ba |
line wrap: on
line diff
--- a/liboctave/Array.cc Wed Feb 04 04:32:48 2004 +0000 +++ b/liboctave/Array.cc Wed Feb 04 18:40:03 2004 +0000 @@ -2746,36 +2746,16 @@ { // RHS is matrix or higher dimension. - bool dim_ok = true; - - int jj = 0; - // Check that RHS dimensions are the same length as the - // corresponding LHS dimensions. - - int rhs_dims_len = rhs_dims.length (); - - for (int j = 0; j < idx_is_colon.length (); j++) - { - if (jj < rhs_dims.length () && rhs_dims(jj) == 1) - jj++; - else if (idx_is_colon(j)) - { - if (jj > rhs_dims_len || rhs_dims(jj) < lhs_dims(j)) - { - dim_ok = false; - - break; - } - - jj++; - } - } - - if (jj != rhs_dims_len) - dim_ok = false; - - if (! dim_ok) + // corresponding LHS index dimensions. + + dim_vector t_rhs_dims = rhs_dims; + t_rhs_dims.chop_trailing_singletons (); + + dim_vector t_frozen_len = frozen_len; + t_frozen_len.chop_trailing_singletons (); + + if (t_rhs_dims != t_frozen_len) (*current_liboctave_error_handler) ("subscripted assignment dimension mismatch"); else