diff src/ov-cx-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 ea1d3e1a4b1b
children 508238e65af7
line wrap: on
line diff
--- a/src/ov-cx-mat.cc
+++ b/src/ov-cx-mat.cc
@@ -135,9 +135,15 @@
   if (! force_conversion && Vwarn_imag_to_real)
     gripe_implicit_conversion ("complex matrix", "real scalar");
 
-  if ((rows () == 1 && columns () == 1)
-      || (Vdo_fortran_indexing && rows () > 0 && columns () > 0))
-    retval = std::real (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 ("complex matrix", "real scalar");
+
+      retval = std::real (matrix (0, 0));
+    }
   else
     gripe_invalid_conversion ("complex matrix", "real scalar");
 
@@ -164,9 +170,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 ("complex matrix", "complex scalar");
+
+      retval = matrix (0, 0);
+    }
   else
     gripe_invalid_conversion ("complex matrix", "complex scalar");