changeset 1594:4da3d91d1a17

[project @ 1995-10-31 23:39:59 by jwe]
author jwe
date Tue, 31 Oct 1995 23:39:59 +0000
parents 2790524e1932
children f110a90eb183
files liboctave/Array-idx.h
diffstat 1 files changed, 24 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/Array-idx.h	Tue Oct 31 23:16:06 1995 +0000
+++ b/liboctave/Array-idx.h	Tue Oct 31 23:39:59 1995 +0000
@@ -608,16 +608,35 @@
 
 		      if (len > 0)
 			{
-			  if (pcv_flag)
+			  int idx_nr = idx.orig_rows ();
+			  int idx_nc = idx.orig_columns ();
+
+			  if (dfi_flag || (idx_nr == 1 && idx_nc == 1))
+			    {
+			      if (pcv_flag)
+				{
+				  lhs.d1 = lhs.length ();
+				  lhs.d2 = 1;
+				}
+			      else
+				{
+				  lhs.d1 = 1;
+				  lhs.d2 = lhs.length ();
+				}
+			    }
+			  else if (idx_nr == 1 && rhs_nr == 1)
+			    {
+			      lhs.d1 = 1;
+			      lhs.d2 = lhs.length ();
+			    }
+			  else if (idx_nc == 1 && rhs_nc == 1)
 			    {
 			      lhs.d1 = lhs.length ();
 			      lhs.d2 = 1;
 			    }
 			  else
-			    {
-			      lhs.d1 = 1;
-			      lhs.d2 = lhs.length ();
-			    }
+			    (*current_liboctave_error_handler)
+      ("A(I) = X: X must be a scalar or a matrix with the same size as I");
 			}
 		      else
 			{