Mercurial > hg > octave-lyh
diff liboctave/fNDArray.cc @ 11008:3622db30ff05
simplify some array tests in liboctave
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 21 Sep 2010 13:09:12 +0200 |
parents | b47ab50a6aa8 |
children | 9478b216752e |
line wrap: on
line diff
--- a/liboctave/fNDArray.cc +++ b/liboctave/fNDArray.cc @@ -514,7 +514,7 @@ return true; } else - return mx_inline_any_negative (numel (), data ()); + return do_mx_check<float> (*this, mx_inline_any_negative); return false; } @@ -522,31 +522,13 @@ bool FloatNDArray::any_element_is_nan (void) const { - octave_idx_type nel = nelem (); - - for (octave_idx_type i = 0; i < nel; i++) - { - float val = elem (i); - if (xisnan (val)) - return true; - } - - return false; + return do_mx_check<float> (*this, mx_inline_any_nan); } bool FloatNDArray::any_element_is_inf_or_nan (void) const { - octave_idx_type nel = nelem (); - - for (octave_idx_type i = 0; i < nel; i++) - { - float val = elem (i); - if (xisinf (val) || xisnan (val)) - return true; - } - - return false; + return ! do_mx_check<float> (*this, mx_inline_all_finite); } bool