diff liboctave/boolNDArray.cc @ 8780:ea76466605ba

support native cumsum, gripe on overflow in sum/cumsum
author Jaroslav Hajek <highegg@gmail.com>
date Tue, 17 Feb 2009 14:23:35 +0100
parents b756ce0002db
children eb63fbe60fab
line wrap: on
line diff
--- a/liboctave/boolNDArray.cc
+++ b/liboctave/boolNDArray.cc
@@ -65,6 +65,13 @@
   return do_mx_red_op<Array<octave_idx_type> > (*this, dim, mx_inline_count);
 }
 
+NDArray 
+boolNDArray::cumsum (int dim) const
+{
+  // NOTE: going via octave_idx_type is faster even though it requires a conversion.
+  return do_mx_cum_op<Array<octave_idx_type> > (*this, dim, mx_inline_cumcount);
+}
+
 boolNDArray
 boolNDArray::concat (const boolNDArray& rb, const Array<octave_idx_type>& ra_idx)
 {