diff liboctave/dNDArray.cc @ 5943:c038c2947ee1

[project @ 2006-08-18 21:27:03 by jwe]
author jwe
date Fri, 18 Aug 2006 21:27:04 +0000
parents ace8d8d26933
children 2d326000e09b
line wrap: on
line diff
--- a/liboctave/dNDArray.cc
+++ b/liboctave/dNDArray.cc
@@ -531,6 +531,21 @@
 }
 
 bool
+NDArray::any_element_not_one_or_zero (void) const
+{
+  octave_idx_type nel = nelem ();
+
+  for (octave_idx_type i = 0; i < nel; i++)
+    {
+      double val = elem (i);
+      if (val != 0 && val != 1)
+	return true;
+    }
+
+  return false;
+}
+
+bool
 NDArray::all_elements_are_int_or_inf_or_nan (void) const
 {
   octave_idx_type nel = nelem ();