diff liboctave/CMatrix.cc @ 9551:19d298e6f7e5

make ! operator check for NaNs, simplify implementations in liboctave
author Jaroslav Hajek <highegg@gmail.com>
date Fri, 21 Aug 2009 08:18:16 +0200
parents 3d6a9aea2aea
children 0c72d9284087
line wrap: on
line diff
--- a/liboctave/CMatrix.cc	Wed Aug 19 22:55:15 2009 +0200
+++ b/liboctave/CMatrix.cc	Fri Aug 21 08:18:16 2009 +0200
@@ -3058,16 +3058,8 @@
 boolMatrix
 ComplexMatrix::operator ! (void) const
 {
-  octave_idx_type nr = rows ();
-  octave_idx_type nc = cols ();
-
-  boolMatrix b (nr, nc);
-
-  for (octave_idx_type j = 0; j < nc; j++)
-    for (octave_idx_type i = 0; i < nr; i++)
-      b.elem (i, j) = elem (i, j) == 0.0;
-
-  return b;
+  ND_LOGICAL_NAN_CHECK (*this);
+  return do_mx_unary_op<boolMatrix, ComplexMatrix> (*this, mx_inline_iszero);
 }
 
 // other operations