Mercurial > hg > octave-nkf
diff liboctave/fCMatrix.cc @ 8743:1bd918cfb6e2
reimplement any & all using the new reduction code
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sat, 14 Feb 2009 19:50:43 +0100 |
parents | 53b4fdeacc2e |
children | b756ce0002db |
line wrap: on
line diff
--- a/liboctave/fCMatrix.cc +++ b/liboctave/fCMatrix.cc @@ -3246,53 +3246,13 @@ boolMatrix FloatComplexMatrix::all (int dim) const { - // FIXME Can't use MX_ALL_OP as need to static cast to float to the ROW - // and COL expressions - -#define ROW_EXPR \ - if (elem (i, j) == static_cast<float> (0.0)) \ - { \ - retval.elem (i, 0) = false; \ - break; \ - } - -#define COL_EXPR \ - if (elem (i, j) == static_cast<float> (0.0)) \ - { \ - retval.elem (0, j) = false; \ - break; \ - } - - MX_BASE_REDUCTION_OP (boolMatrix, ROW_EXPR, COL_EXPR, true, true); - -#undef ROW_EXPR -#undef COL_EXPR + return do_mx_red_op<boolMatrix> (*this, dim, mx_inline_all); } boolMatrix FloatComplexMatrix::any (int dim) const { - // FIXME Can't use MX_ANY_OP as need to static cast to float to the ROW - // and COL expressions - -#define ROW_EXPR \ - if (elem (i, j) != static_cast<float> (0.0)) \ - { \ - retval.elem (i, 0) = true; \ - break; \ - } - -#define COL_EXPR \ - if (elem (i, j) != static_cast<float> (0.0)) \ - { \ - retval.elem (0, j) = true; \ - break; \ - } - - MX_BASE_REDUCTION_OP (boolMatrix, ROW_EXPR, COL_EXPR, false, false); - -#undef ROW_EXPR -#undef COL_EXPR + return do_mx_red_op<boolMatrix> (*this, dim, mx_inline_any); } FloatComplexMatrix