diff liboctave/CMatrix.cc @ 7922:935be827eaf8

error for NaN values in & and | expressions
author John W. Eaton <jwe@octave.org>
date Fri, 11 Jul 2008 14:56:30 -0400
parents 9bcb31cc56be
children 851803f7bb4d
line wrap: on
line diff
--- a/liboctave/CMatrix.cc	Thu Jul 10 17:36:20 2008 -0400
+++ b/liboctave/CMatrix.cc	Fri Jul 11 14:56:30 2008 -0400
@@ -3302,6 +3302,23 @@
 }
 
 bool
+ComplexMatrix::any_element_is_nan (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++)
+      {
+	Complex val = elem (i, j);
+	if (xisnan (val))
+	  return true;
+      }
+
+  return false;
+}
+
+bool
 ComplexMatrix::any_element_is_inf_or_nan (void) const
 {
   octave_idx_type nr = rows ();