diff liboctave/CSparse.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
parents f80c566bc751
children 829e69ec3110
line wrap: on
line diff
--- a/liboctave/CSparse.cc
+++ b/liboctave/CSparse.cc
@@ -53,6 +53,7 @@
 #include "Sparse-diag-op-defs.h"
 
 #include "Sparse-perm-op-defs.h"
+#include "mx-inlines.cc"
 
 // Define whether to use a basic QR solver or one that uses a Dulmange
 // Mendelsohn factorization to seperate the problem into under-determined,
@@ -7268,17 +7269,7 @@
 bool
 SparseComplexMatrix::all_elements_are_real (void) const
 {
-  octave_idx_type nel = nnz ();
-
-  for (octave_idx_type i = 0; i < nel; i++)
-    {
-      double ip = std::imag (data (i));
-      
-      if (ip != 0.0 || lo_ieee_signbit (ip))
-	return false;
-    }
-
-  return true;
+  return mx_inline_all_real (nnz (), data ());
 }
 
 // Return nonzero if any element of CM has a non-integer real or