diff src/ov-re-mat.cc @ 4455:abbf63293766

[project @ 2003-07-11 01:01:16 by jwe]
author jwe
date Fri, 11 Jul 2003 01:01:17 +0000
parents f3c21a1d1c62
children d7d9ca19960a
line wrap: on
line diff
--- a/src/ov-re-mat.cc	Fri Jul 11 00:58:56 2003 +0000
+++ b/src/ov-re-mat.cc	Fri Jul 11 01:01:17 2003 +0000
@@ -86,9 +86,14 @@
   double retval = lo_ieee_nan_value ();
 
   // XXX FIXME XXX -- maybe this should be a function, valid_as_scalar()
-  if ((rows () == 1 && columns () == 1)
-      || (Vdo_fortran_indexing && rows () > 0 && columns () > 0))
-    retval = matrix (0, 0);
+  if (rows () > 0 && columns () > 0)
+    {
+      // XXX FIXME XXX -- is warn_fortran_indexing the right variable here?
+      if (Vwarn_fortran_indexing)
+	gripe_implicit_conversion ("real matrix", "real scalar");
+
+      retval = matrix (0, 0);
+    }
   else
     gripe_invalid_conversion ("real matrix", "real scalar");
 
@@ -102,9 +107,15 @@
 
   Complex retval (tmp, tmp);
 
-  if ((rows () == 1 && columns () == 1)
-      || (Vdo_fortran_indexing && rows () > 0 && columns () > 0))
-    retval = matrix (0, 0);
+  // XXX FIXME XXX -- maybe this should be a function, valid_as_scalar()
+  if (rows () > 0 && columns () > 0)
+    {
+      // XXX FIXME XXX -- is warn_fortran_indexing the right variable here?
+      if (Vwarn_fortran_indexing)
+	gripe_implicit_conversion ("real matrix", "complex scalar");
+
+      retval = matrix (0, 0);
+    }
   else
     gripe_invalid_conversion ("real matrix", "complex scalar");