Mercurial > octave
diff liboctave/array/fNDArray.cc @ 18725:8cc66f091584
Add "native" option to prod() (bug #40349).
* data.cc (Fprod): Rewrite docstring to mention new "native", "double" options.
Borrow code from Fsum replacing sum with prod. Add %!tests for new behavior.
* fCNDArray.h (dprod): New function prototype.
* fCNDArray.cc (FloatComplexNDArray::dprod): New function.
* fNDArray.h (dprod): New function prototype.
* fNDArray.cc (FloatNDArray::dprod): New function.
* intNDArray.h (prod): New function prototype.
* intNDArray.cc (intNDArray<T>::prod): New function.
* mx-inlines.cc (op_dble_prod): New inline functions for implementing double
product.
author | Rik <rik@octave.org> |
---|---|
date | Sun, 04 May 2014 16:08:46 -0700 |
parents | 49a5a4be04a1 |
children | d0c73e23a505 |
line wrap: on
line diff
--- a/liboctave/array/fNDArray.cc Sat May 03 17:28:49 2014 -0700 +++ b/liboctave/array/fNDArray.cc Sun May 04 16:08:46 2014 -0700 @@ -627,6 +627,12 @@ return do_mx_red_op<float, float> (*this, dim, mx_inline_prod); } +NDArray +FloatNDArray::dprod (int dim) const +{ + return do_mx_red_op<double, float> (*this, dim, mx_inline_dprod); +} + FloatNDArray FloatNDArray::sum (int dim) const {