comparison liboctave/CNDArray.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
comparison
equal deleted inserted replaced
9550:3d6a9aea2aea 9551:19d298e6f7e5
495 // unary operations 495 // unary operations
496 496
497 boolNDArray 497 boolNDArray
498 ComplexNDArray::operator ! (void) const 498 ComplexNDArray::operator ! (void) const
499 { 499 {
500 boolNDArray b (dims ()); 500 ND_LOGICAL_NAN_CHECK (*this);
501 501 return do_mx_unary_op<boolNDArray, ComplexNDArray> (*this, mx_inline_iszero);
502 for (octave_idx_type i = 0; i < length (); i++)
503 b.elem (i) = elem (i) == 0.0;
504
505 return b;
506 } 502 }
507 503
508 // FIXME -- this is not quite the right thing. 504 // FIXME -- this is not quite the right thing.
509 505
510 bool 506 bool