Mercurial > hg > octave-nkf
diff liboctave/fCNDArray.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/fCNDArray.cc +++ b/liboctave/fCNDArray.cc @@ -492,12 +492,8 @@ boolNDArray FloatComplexNDArray::operator ! (void) const { - boolNDArray b (dims ()); - - for (octave_idx_type i = 0; i < length (); i++) - b.elem (i) = elem (i) == static_cast<float> (0.0); - - return b; + ND_LOGICAL_NAN_CHECK (*this); + return do_mx_unary_op<boolNDArray, FloatComplexNDArray> (*this, mx_inline_iszero); } // FIXME -- this is not quite the right thing.