diff src/ov-cell.cc @ 7040:1f16da18d85d

[project @ 2007-10-19 18:24:19 by jwe]
author jwe
date Fri, 19 Oct 2007 18:24:19 +0000
parents a1dbe9d80eee
children c8d362c69013
line wrap: on
line diff
--- a/src/ov-cell.cc
+++ b/src/ov-cell.cc
@@ -252,9 +252,12 @@
 	      {
 		Cell tmp_cell = Cell (t_rhs.list_value ());
 
-		// FIXME -- shouldn't care if the dimensions of the
-		// RHS don't match the dimensions of the subscripted
-		// LHS.
+		// The shape of the RHS is irrelevant, we just want
+		// the number of elements to agree and to preserve the
+		// shape of the left hand side of the assignment.
+
+		if (numel () == tmp_cell.numel ())
+		  tmp_cell = tmp_cell.reshape (dims ());
 
 		octave_base_matrix<Cell>::assign (i, tmp_cell);
 	      }