changeset 855:f4feb9b57f12

[project @ 1994-10-21 19:22:27 by jwe]
author jwe
date Fri, 21 Oct 1994 19:22:27 +0000
parents fb983bf4fd07
children 8e0e864a7d30
files src/tc-rep-ass.cc
diffstat 1 files changed, 9 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/src/tc-rep-ass.cc	Fri Oct 21 19:02:15 1994 +0000
+++ b/src/tc-rep-ass.cc	Fri Oct 21 19:22:27 1994 +0000
@@ -847,42 +847,20 @@
       int nr = rows ();
       int nc = columns ();
 
-      if (nr == 1)
+      if (nr == 1 && rhs_nr == 1)
 	{
-	  if (rhs_nr == 1)
-	    {
-	      for (int i = 0; i < iv.capacity (); i++)
-		REP_ELEM_ASSIGN (0, iv.elem (i), rhs_m.elem (0, i),
-				 rhs_cm.elem (0, i), rhs.is_real_type ());
-	    }
-	  else if (rhs_nc == 1)
-	    {
-	      for (int i = 0; i < iv.capacity (); i++)
-		REP_ELEM_ASSIGN (0, iv.elem (i), rhs_m.elem (i, 0),
-				 rhs_cm.elem (i, 0), rhs.is_real_type ());
-	    }
-	  else
-	    panic_impossible ();
+	  for (int i = 0; i < iv.capacity (); i++)
+	    REP_ELEM_ASSIGN (0, iv.elem (i), rhs_m.elem (0, i),
+			     rhs_cm.elem (0, i), rhs.is_real_type ());
 	}
-      else if (nc == 1)
+      else if (nc == 1 && rhs_nc == 1)
 	{
-	  if (rhs_nr == 1)
-	    {
-	      for (int i = 0; i < iv.capacity (); i++)
-		REP_ELEM_ASSIGN (iv.elem (i), 0, rhs_m.elem (0, i),
-				 rhs_cm.elem (0, i), rhs.is_real_type ());
-	    }
-	  else if (rhs_nc == 1)
-	    {
-	      for (int i = 0; i < iv.capacity (); i++)
-		REP_ELEM_ASSIGN (iv.elem (i), 0, rhs_m.elem (i, 0),
-				 rhs_cm.elem (i, 0), rhs.is_real_type ());
-	    }
-	  else
-	    panic_impossible ();
+	  for (int i = 0; i < iv.capacity (); i++)
+	    REP_ELEM_ASSIGN (iv.elem (i), 0, rhs_m.elem (i, 0),
+			     rhs_cm.elem (i, 0), rhs.is_real_type ());
 	}
       else
-	panic_impossible ();
+	::error ("A(vector) = X: X must be the same size as vector");
     }
   else
     panic_impossible ();