diff liboctave/CNDArray.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/CNDArray.cc
+++ b/liboctave/CNDArray.cc
@@ -74,38 +74,18 @@
 
 // XXX FIXME XXX -- this is not quite the right thing.
 
-boolMatrix
+boolNDArray
 ComplexNDArray::all (int dim) const
 {
-  boolMatrix retval;
-
-  if (dimensions.length () == 2)
-    {
-      ComplexMatrix 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 (real (elem (iter_idx)) == 0
+				 && imag (elem (iter_idx)) == 0));
 }
 
-boolMatrix
+boolNDArray
 ComplexNDArray::any (int dim) const
 {
-  boolMatrix retval;
-
-  if (dimensions.length () == 2)
-    {
-      ComplexMatrix 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 (real (elem (iter_idx))
+				 || imag (elem (iter_idx))));
 }
 
 ComplexMatrix
@@ -143,6 +123,13 @@
   ::increment_index (ra_idx, dimensions, start_dimension);
 }
 
+int 
+ComplexNDArray::compute_index (Array<int>& ra_idx,
+			       const dim_vector& dimensions)
+{
+  return ::compute_index (ra_idx, dimensions);
+}
+
 NDS_CMP_OPS(ComplexNDArray, real, Complex, real)
 NDS_BOOL_OPS(ComplexNDArray, Complex, 0.0)