diff liboctave/boolNDArray.cc @ 4543:79df15d4470c

[project @ 2003-10-18 03:53:52 by jwe]
author jwe
date Sat, 18 Oct 2003 03:53:53 +0000
parents 01ee68d18069
children 773a21e4fce8
line wrap: on
line diff
--- a/liboctave/boolNDArray.cc
+++ b/liboctave/boolNDArray.cc
@@ -35,6 +35,19 @@
 
 #include "ArrayN-inline.h"
 
+// unary operations
+
+boolNDArray
+boolNDArray::operator ! (void) const
+{
+  boolNDArray b (dims ());
+
+  for (int i = 0; i < length (); i++)
+    b.elem (i) = ! elem (i);
+
+  return b;
+}
+
 // XXX FIXME XXX -- this is not quite the right thing.
 
 boolMatrix
@@ -106,6 +119,8 @@
   ::increment_index (ra_idx, dimensions, start_dimension);
 }
 
+NDND_CMP_OPS (boolNDArray, , boolNDArray, )
+
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***