From bc72fdd41b35b033c238b5f86cdded2ad5b5591e Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Sun, 10 May 2009 03:59:34 +0000 Subject: Back-port bug-fix to reduceat (r6977) to 1.3.x branch. --- numpy/core/src/umath_ufunc_object.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numpy/core/src/umath_ufunc_object.inc b/numpy/core/src/umath_ufunc_object.inc index 3447a1d2b..c5b45e60f 100644 --- a/numpy/core/src/umath_ufunc_object.inc +++ b/numpy/core/src/umath_ufunc_object.inc @@ -2848,7 +2848,7 @@ PyUFunc_Reduceat(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *ind, while (loop->index < loop->size) { ptr = (intp *)ind->data; for (i = 0; i < nn; i++) { - loop->bufptr[1] = loop->it->dataptr + (*ptr)*loop->instrides; + loop->bufptr[1] = loop->it->dataptr + (*ptr)*loop->steps[1]; if (loop->obj) { Py_XINCREF(*((PyObject **)loop->bufptr[1])); } @@ -2856,7 +2856,7 @@ PyUFunc_Reduceat(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *ind, mm = (i == nn - 1 ? arr->dimensions[axis] - *ptr : *(ptr + 1) - *ptr) - 1; if (mm > 0) { - loop->bufptr[1] += loop->instrides; + loop->bufptr[1] += loop->steps[1]; loop->bufptr[2] = loop->bufptr[0]; loop->function((char **)loop->bufptr, &mm, loop->steps, loop->funcdata); -- cgit v1.2.1