changeset 5379:27986bd3e238

[project @ 2005-06-02 18:21:20 by jwe]
author jwe
date Thu, 02 Jun 2005 18:21:20 +0000
parents b2a5596a3f7b
children 1eb29d3bed2b
files liboctave/Array.cc liboctave/ChangeLog
diffstat 2 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/Array.cc	Thu Jun 02 16:01:25 2005 +0000
+++ b/liboctave/Array.cc	Thu Jun 02 18:21:20 2005 +0000
@@ -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
--- a/liboctave/ChangeLog	Thu Jun 02 16:01:25 2005 +0000
+++ b/liboctave/ChangeLog	Thu Jun 02 18:21:20 2005 +0000
@@ -1,3 +1,8 @@
+2005-06-02  John W. Eaton  <jwe@octave.org>
+
+	* Array.cc (assignN): Try harder to correctly resize previously
+	empty LHS.
+
 2005-05-16  David Bateman  <dbateman@free.fr>
 
 	* dSparse.h: Change UMFPACK_LONG_IDX to IDX_TYPE_LONG.