diff liboctave/boolNDArray.cc @ 9607:1be3c73ed7b5

reuse temporary arrays in nested expressions
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 03 Sep 2009 08:48:51 +0200
parents a9b37bae1802
children 66970dd627f6
line wrap: on
line diff
--- a/liboctave/boolNDArray.cc
+++ b/liboctave/boolNDArray.cc
@@ -42,6 +42,17 @@
   return do_mx_unary_op<boolNDArray> (*this, mx_inline_not);
 }
 
+boolNDArray&
+boolNDArray::invert (void)
+{
+  if (is_shared ())
+    *this = ! *this;
+  else
+    do_mx_inplace_op<boolNDArray> (*this, mx_inline_not2);
+
+  return *this;
+}
+
 // FIXME -- this is not quite the right thing.
 
 boolNDArray