diff liboctave/boolMatrix.cc @ 3203:bc61b0e8d60e

[project @ 1998-10-30 20:26:27 by jwe]
author jwe
date Fri, 30 Oct 1998 20:26:31 +0000
parents 8b262e771614
children 7aae2c3636a7
line wrap: on
line diff
--- a/liboctave/boolMatrix.cc
+++ b/liboctave/boolMatrix.cc
@@ -75,6 +75,25 @@
   return result;
 }
 
+// unary operations
+
+boolMatrix
+boolMatrix::operator ! (void) const
+{
+  int nr = rows ();
+  int nc = cols ();
+
+  boolMatrix b (nr, nc);
+
+  for (int j = 0; j < nc; j++)
+    for (int i = 0; i < nr; i++)
+      b.elem (i, j) = ! elem (i, j);
+
+  return b;
+}
+
+// other operations
+
 boolMatrix
 boolMatrix::all (void) const
 {