summaryrefslogtreecommitdiff
path: root/scipy/base/src
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2005-10-04 04:31:21 +0000
committerTravis Oliphant <oliphant@enthought.com>2005-10-04 04:31:21 +0000
commit118022b553e5c0e878b09916af5cb7a1a950a19f (patch)
tree0aa3c6e7bee5037b3889afcadc8ee9f7d085fef4 /scipy/base/src
parentfd10c4389d6e5bba194f6d8fda8ae500183360c8 (diff)
downloadnumpy-118022b553e5c0e878b09916af5cb7a1a950a19f.tar.gz
Fixed Broadcasting problem introduced by previous fixes...
Diffstat (limited to 'scipy/base/src')
-rw-r--r--scipy/base/src/ufuncobject.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/scipy/base/src/ufuncobject.c b/scipy/base/src/ufuncobject.c
index e4d1a190b..96bb27843 100644
--- a/scipy/base/src/ufuncobject.c
+++ b/scipy/base/src/ufuncobject.c
@@ -846,7 +846,7 @@ construct_matrices(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps)
&(loop->funcdata), scalars) == -1)
return -1;
- /* This is the buffer size in number of elements...*/
+ /* This is the buffer size in number of elements.*/
loop->bufsize = _getintfromvar(UFUNC_BUFSIZE_NAME, PyArray_BUFSIZE);
if ((loop->bufsize < PyArray_MIN_BUFSIZE) || \
(loop->bufsize > PyArray_MAX_BUFSIZE)) {
@@ -871,7 +871,6 @@ construct_matrices(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps)
loop->numiter = self->nin;
if (PyArray_Broadcast((PyArrayMultiIterObject *)loop) < 0)
return -1;
-
/* Get any return arguments */
for (i=self->nin; i<nargs; i++) {
@@ -974,12 +973,13 @@ construct_matrices(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps)
for (i=0; i<self->nargs; i++) {
if (!(loop->iters[i]->contiguous)) {
/* may still have uniform stride
- if <= 1-d */
- if (mps[i]->nd > 1) {
+ if (broadcated result) <= 1-d */
+ if (mps[i]->nd != 0 && \
+ (loop->iters[i]->nd_m1 > 0)) {
loop->meth = NOBUFFER_UFUNCLOOP;
+ break;
}
- break;
- }
+ }
}
if (loop->meth == ONE_UFUNCLOOP) {
for (i=0; i<self->nargs; i++) {