diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-05-10 20:58:54 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-05-10 20:58:54 +0000 |
commit | ac244d26c185bcc79e2d22bc008dee1e40692d8d (patch) | |
tree | 6c92a48dab5d0018968169ac946626f41db6cfab | |
parent | 67eeb36aee72eae9a2ac42765fb11b63613f05cb (diff) | |
download | numpy-ac244d26c185bcc79e2d22bc008dee1e40692d8d.tar.gz |
Fix ticket #106
-rw-r--r-- | numpy/core/blasdot/_dotblas.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/numpy/core/blasdot/_dotblas.c b/numpy/core/blasdot/_dotblas.c index ae4e8299c..56e901310 100644 --- a/numpy/core/blasdot/_dotblas.c +++ b/numpy/core/blasdot/_dotblas.c @@ -183,6 +183,7 @@ dotblas_matrixproduct(PyObject *dummy, PyObject *args) int typenum, nd; intp ap1stride=0; intp dimensions[MAX_DIMS]; + intp numbytes; static const float oneF[2] = {1.0, 0.0}; static const float zeroF[2] = {0.0, 0.0}; static const double oneD[2] = {1.0, 0.0}; @@ -238,13 +239,13 @@ dotblas_matrixproduct(PyObject *dummy, PyObject *args) if (!PyArray_ElementStrides((PyObject *)ap1)) { op1 = PyArray_NewCopy(ap1, PyArray_ANYORDER); Py_DECREF(ap1); - ap1 = op1; + ap1 = (PyArrayObject *)op1; if (ap1 == NULL) goto fail; } if (!PyArray_ElementStrides((PyObject *)ap2)) { op2 = PyArray_NewCopy(ap2, PyArray_ANYORDER); Py_DECREF(ap2); - ap2 = op2; + ap2 = (PyArrayObject *)op2; if (ap2 == NULL) goto fail; } ap1shape = _select_matrix_shape(ap1); @@ -349,8 +350,9 @@ dotblas_matrixproduct(PyObject *dummy, PyObject *args) (prior2 > prior1 ? ap2 : ap1)); if (ret == NULL) goto fail; - memset(ret->data, 0, PyArray_NBYTES(ret)); - if (l==0) { + numbytes = PyArray_NBYTES(ret); + memset(ret->data, 0, numbytes); + if (numbytes==0) { Py_DECREF(ap1); Py_DECREF(ap2); return PyArray_Return(ret); |