diff liboctave/intNDArray.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 7e958a1532c6
line wrap: on
line diff
--- a/liboctave/intNDArray.cc	Fri Aug 18 18:57:06 2006 +0000
+++ b/liboctave/intNDArray.cc	Fri Aug 18 21:27:04 2006 +0000
@@ -44,6 +44,23 @@
   return b;
 }
 
+template <class T>
+bool
+intNDArray<T>::any_element_not_one_or_zero (void) const
+{
+  octave_idx_type nel = this->nelem ();
+
+  for (octave_idx_type i = 0; i < nel; i++)
+    {
+      T val = this->elem (i);
+
+      if (val != 0.0 && val != 1.0)
+	return true;
+    }
+
+  return false;
+}
+
 // FIXME -- this is not quite the right thing.
 
 template <class T>