Mercurial > octave-nkf
diff liboctave/fCMatrix.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/fCMatrix.cc Wed Aug 19 22:55:15 2009 +0200 +++ b/liboctave/fCMatrix.cc Fri Aug 21 08:18:16 2009 +0200 @@ -3051,16 +3051,8 @@ boolMatrix FloatComplexMatrix::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) == static_cast<float> (0.0); - - return b; + ND_LOGICAL_NAN_CHECK (*this); + return do_mx_unary_op<boolMatrix, FloatComplexMatrix> (*this, mx_inline_iszero); } // other operations