# HG changeset patch # User jwe # Date 1117736480 0 # Node ID 27986bd3e23890b346f9173fd24a331e80ad4ce6 # Parent b2a5596a3f7bacb95261cc6ff734bd4a56a76a93 [project @ 2005-06-02 18:21:20 by jwe] diff --git a/liboctave/Array.cc b/liboctave/Array.cc --- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -3027,14 +3027,24 @@ if (k < rhs_dims.length ()) new_dims(i) = rhs_dims(k++); else + new_dims(i) = 1; + } + else + { + octave_idx_type nelem = idx(i).capacity (); + + if (nelem >= 1 + && k < rhs_dims.length () && nelem == rhs_dims(k)) + k++; + else if (nelem != 1) { (*current_liboctave_error_handler) - ("A(IDX-LIST) = RHS: A previously undefined and more colons in IDX-LIST than dimensions for RHS"); + ("A(IDX-LIST) = RHS: mismatched index and RHS dimension"); return retval; } + + new_dims(i) = idx(i).max () + 1; } - else - new_dims(i) = idx(i).max () + 1; } } else diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2005-06-02 John W. Eaton + + * Array.cc (assignN): Try harder to correctly resize previously + empty LHS. + 2005-05-16 David Bateman * dSparse.h: Change UMFPACK_LONG_IDX to IDX_TYPE_LONG.