Mercurial > hg > octave-nkf
diff liboctave/dNDArray.cc @ 4556:773a21e4fce8
[project @ 2003-10-28 05:02:10 by jwe]
author | jwe |
---|---|
date | Tue, 28 Oct 2003 05:02:10 +0000 |
parents | 79df15d4470c |
children | 742993a501b9 |
line wrap: on
line diff
--- a/liboctave/dNDArray.cc +++ b/liboctave/dNDArray.cc @@ -65,38 +65,16 @@ // XXX FIXME XXX -- this is not quite the right thing. -boolMatrix +boolNDArray NDArray::all (int dim) const { - boolMatrix retval; - - if (dimensions.length () == 2) - { - Matrix tmp = matrix_value (); - retval = tmp.all (dim); - } - else - (*current_liboctave_error_handler) - ("all is not yet implemented for N-d Arrays"); - - return retval; + MX_ND_ALL_ANY (MX_ND_ALL_EVAL (MX_ND_ALL_EXPR)); } -boolMatrix +boolNDArray NDArray::any (int dim) const { - boolMatrix retval; - - if (dimensions.length () == 2) - { - Matrix tmp = matrix_value (); - retval = tmp.any (dim); - } - else - (*current_liboctave_error_handler) - ("any is not yet implemented for N-d Arrays"); - - return retval; + MX_ND_ALL_ANY (MX_ND_ANY_EVAL (MX_ND_ANY_EXPR)); } Matrix @@ -133,6 +111,13 @@ ::increment_index (ra_idx, dimensions, start_dimension); } +int +NDArray::compute_index (Array<int>& ra_idx, + const dim_vector& dimensions) +{ + return ::compute_index (ra_idx, dimensions); +} + bool NDArray::any_element_is_negative (bool neg_zero) const {