diff liboctave/dNDArray.cc @ 4584:f7697d703481

[project @ 2003-10-31 19:47:35 by jwe]
author jwe
date Fri, 31 Oct 2003 19:47:36 +0000
parents 01e4957409a4
children 19bfd295f400
line wrap: on
line diff
--- a/liboctave/dNDArray.cc	Fri Oct 31 15:20:51 2003 +0000
+++ b/liboctave/dNDArray.cc	Fri Oct 31 19:47:36 2003 +0000
@@ -65,6 +65,7 @@
 
 // XXX FIXME XXX -- this is not quite the right thing.
 
+
 boolNDArray
 NDArray::all (int dim) const
 {
@@ -77,36 +78,16 @@
   MX_ND_ANY_ALL_REDUCTION (MX_ND_ANY_EVAL (MX_ND_ANY_EXPR), false);
 }
 
-Matrix
+NDArray
 NDArray::cumprod (int dim) const
 {
- if (dims () . length () == 2)
-   {
-     MX_CUMULATIVE_OP (Matrix, double, *=);
-   }
- else
-   {
-     (*current_liboctave_error_handler)
-       ("cumprod is not yet implemented for N-d arrays");
-
-     return Matrix ();
-   }
+  MX_ND_CUMULATIVE_OP (NDArray, double, 1, *);
 }
 
-Matrix
+NDArray
 NDArray::cumsum (int dim) const
 {
-  if (dims () . length () == 2)
-    {
-      MX_CUMULATIVE_OP (Matrix, double, +=);
-    }
-  else
-    {
-      (*current_liboctave_error_handler)
-	("cumprod is not yet implemented for N-d arrays");
-
-      return Matrix ();
-    }
+  MX_ND_CUMULATIVE_OP (NDArray, double, 0, +);
 }
 
 NDArray