diff liboctave/CMatrix.cc @ 9825:7483fe200fab

narrow complex values with negative zero imaginary parts
author Jaroslav Hajek <highegg@gmail.com>
date Fri, 13 Nov 2009 12:34:46 +0100 (2009-11-13)
parents f80c566bc751
children 018d92ad0730
line wrap: on
line diff
--- a/liboctave/CMatrix.cc
+++ b/liboctave/CMatrix.cc
@@ -3118,21 +3118,7 @@
 bool
 ComplexMatrix::all_elements_are_real (void) const
 {
-  octave_idx_type nr = rows ();
-  octave_idx_type nc = cols ();
-
-  for (octave_idx_type j = 0; j < nc; j++)
-    {
-      for (octave_idx_type i = 0; i < nr; i++)
-	{
-	  double ip = std::imag (elem (i, j));
-
-	  if (ip != 0.0 || lo_ieee_signbit (ip))
-	    return false;
-	}
-    }
-
-  return true;
+  return mx_inline_all_real (numel (), data ());
 }
 
 // Return nonzero if any element of CM has a non-integer real or