Skip to content

Commit

Permalink
STY: Replace macros in old_define.h with new versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
charris committed Feb 4, 2012
1 parent df4008d commit 8fce1e6
Show file tree
Hide file tree
Showing 22 changed files with 7,713 additions and 7,713 deletions.
4 changes: 2 additions & 2 deletions scipy/cluster/src/vq_module.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ PyObject* compute_vq(PyObject* self, PyObject* args)
if (dist_a == NULL) { if (dist_a == NULL) {
goto clean_code_a; goto clean_code_a;
} }
index_a = (PyArrayObject*)PyArray_EMPTY(1, &n, PyArray_INTP, 0); index_a = (PyArrayObject*)PyArray_EMPTY(1, &n, NPY_INTP, 0);
if (index_a == NULL) { if (index_a == NULL) {
goto clean_dist_a; goto clean_dist_a;
} }
Expand All @@ -134,7 +134,7 @@ PyObject* compute_vq(PyObject* self, PyObject* args)
if (dist_a == NULL) { if (dist_a == NULL) {
goto clean_code_a; goto clean_code_a;
} }
index_a = (PyArrayObject*)PyArray_EMPTY(1, &n, PyArray_INTP, 0); index_a = (PyArrayObject*)PyArray_EMPTY(1, &n, NPY_INTP, 0);
if (index_a == NULL) { if (index_a == NULL) {
goto clean_dist_a; goto clean_dist_a;
} }
Expand Down
36 changes: 18 additions & 18 deletions scipy/integrate/__odepack.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ int setup_extra_inputs(PyArrayObject **ap_rtol, PyObject *o_rtol, PyArrayObject


/* Setup tolerances */ /* Setup tolerances */
if (o_rtol == NULL) { if (o_rtol == NULL) {
*ap_rtol = (PyArrayObject *)PyArray_SimpleNew(1, &one, PyArray_DOUBLE); *ap_rtol = (PyArrayObject *)PyArray_SimpleNew(1, &one, NPY_DOUBLE);
if (*ap_rtol == NULL) PYERR2(odepack_error,"Error constructing relative tolerance."); if (*ap_rtol == NULL) PYERR2(odepack_error,"Error constructing relative tolerance.");
*(double *)(*ap_rtol)->data = tol; /* Default */ *(double *)(*ap_rtol)->data = tol; /* Default */
} }
else { else {
*ap_rtol = (PyArrayObject *)PyArray_ContiguousFromObject(o_rtol,PyArray_DOUBLE,0,1); *ap_rtol = (PyArrayObject *)PyArray_ContiguousFromObject(o_rtol,NPY_DOUBLE,0,1);
if (*ap_rtol == NULL) PYERR2(odepack_error,"Error converting relative tolerance."); if (*ap_rtol == NULL) PYERR2(odepack_error,"Error converting relative tolerance.");
if ((*ap_rtol)->nd == 0); /* rtol is scalar */ if ((*ap_rtol)->nd == 0); /* rtol is scalar */
else if ((*ap_rtol)->dimensions[0] == neq) else if ((*ap_rtol)->dimensions[0] == neq)
Expand All @@ -147,12 +147,12 @@ int setup_extra_inputs(PyArrayObject **ap_rtol, PyObject *o_rtol, PyArrayObject
} }


if (o_atol == NULL) { if (o_atol == NULL) {
*ap_atol = (PyArrayObject *)PyArray_SimpleNew(1,&one,PyArray_DOUBLE); *ap_atol = (PyArrayObject *)PyArray_SimpleNew(1,&one,NPY_DOUBLE);
if (*ap_atol == NULL) PYERR2(odepack_error,"Error constructing absolute tolerance"); if (*ap_atol == NULL) PYERR2(odepack_error,"Error constructing absolute tolerance");
*(double *)(*ap_atol)->data = tol; *(double *)(*ap_atol)->data = tol;
} }
else { else {
*ap_atol = (PyArrayObject *)PyArray_ContiguousFromObject(o_atol,PyArray_DOUBLE,0,1); *ap_atol = (PyArrayObject *)PyArray_ContiguousFromObject(o_atol,NPY_DOUBLE,0,1);
if (*ap_atol == NULL) PYERR2(odepack_error,"Error converting absolute tolerance."); if (*ap_atol == NULL) PYERR2(odepack_error,"Error converting absolute tolerance.");
if ((*ap_atol)->nd == 0); /* atol is scalar */ if ((*ap_atol)->nd == 0); /* atol is scalar */
else if ((*ap_atol)->dimensions[0] == neq) else if ((*ap_atol)->dimensions[0] == neq)
Expand All @@ -165,7 +165,7 @@ int setup_extra_inputs(PyArrayObject **ap_rtol, PyObject *o_rtol, PyArrayObject


/* Setup t-critical */ /* Setup t-critical */
if (o_tcrit != NULL) { if (o_tcrit != NULL) {
*ap_tcrit = (PyArrayObject *)PyArray_ContiguousFromObject(o_tcrit,PyArray_DOUBLE,0,1); *ap_tcrit = (PyArrayObject *)PyArray_ContiguousFromObject(o_tcrit,NPY_DOUBLE,0,1);
if (*ap_tcrit == NULL) PYERR2(odepack_error,"Error constructing critical times."); if (*ap_tcrit == NULL) PYERR2(odepack_error,"Error constructing critical times.");
*numcrit = PyArray_Size((PyObject *)(*ap_tcrit)); *numcrit = PyArray_Size((PyObject *)(*ap_tcrit));
} }
Expand Down Expand Up @@ -193,7 +193,7 @@ int compute_lrw_liw(int *lrw, int *liw, int neq, int jt, int ml, int mu, int mxo
lrn = 20 + nyh*(mxordn+1) + 3*neq; lrn = 20 + nyh*(mxordn+1) + 3*neq;
lrs = 20 + nyh*(mxords+1) + 3*neq + lmat; lrs = 20 + nyh*(mxords+1) + 3*neq + lmat;


*lrw = NPY_MAX(lrn,lrs); *lrw = PyArray_MAX(lrn,lrs);
*liw = 20 + neq; *liw = 20 + neq;
return 0; return 0;


Expand Down Expand Up @@ -252,22 +252,22 @@ static PyObject *odepack_odeint(PyObject *dummy, PyObject *args, PyObject *kwdic
if (mu < 0) mu = 0; if (mu < 0) mu = 0;


/* Initial input vector */ /* Initial input vector */
ap_y = (PyArrayObject *)PyArray_ContiguousFromObject(y0, PyArray_DOUBLE, 0, 1); ap_y = (PyArrayObject *)PyArray_ContiguousFromObject(y0, NPY_DOUBLE, 0, 1);
if (ap_y == NULL) goto fail; if (ap_y == NULL) goto fail;
y = (double *) ap_y->data; y = (double *) ap_y->data;
neq = PyArray_Size((PyObject *)ap_y); neq = PyArray_Size((PyObject *)ap_y);
dims[1] = neq; dims[1] = neq;


/* Set of output times for integration */ /* Set of output times for integration */
ap_tout = (PyArrayObject *)PyArray_ContiguousFromObject(p_tout, PyArray_DOUBLE, 0, 1); ap_tout = (PyArrayObject *)PyArray_ContiguousFromObject(p_tout, NPY_DOUBLE, 0, 1);
if (ap_tout == NULL) goto fail; if (ap_tout == NULL) goto fail;
tout = (double *)ap_tout->data; tout = (double *)ap_tout->data;
ntimes = PyArray_Size((PyObject *)ap_tout); ntimes = PyArray_Size((PyObject *)ap_tout);
dims[0] = ntimes; dims[0] = ntimes;
t = tout[0]; t = tout[0];


/* Setup array to hold the output evaluations*/ /* Setup array to hold the output evaluations*/
ap_yout= (PyArrayObject *)PyArray_SimpleNew(2,dims,PyArray_DOUBLE); ap_yout= (PyArrayObject *)PyArray_SimpleNew(2,dims,NPY_DOUBLE);
if (ap_yout== NULL) goto fail; if (ap_yout== NULL) goto fail;
yout = (double *) ap_yout->data; yout = (double *) ap_yout->data;
/* Copy initial vector into first row of output */ /* Copy initial vector into first row of output */
Expand Down Expand Up @@ -305,15 +305,15 @@ static PyObject *odepack_odeint(PyObject *dummy, PyObject *args, PyObject *kwdic
/* If full output make some useful output arrays */ /* If full output make some useful output arrays */
if (full_output) { if (full_output) {
out_sz = ntimes-1; out_sz = ntimes-1;
ap_hu = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,PyArray_DOUBLE); ap_hu = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,NPY_DOUBLE);
ap_tcur = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,PyArray_DOUBLE); ap_tcur = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,NPY_DOUBLE);
ap_tolsf = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,PyArray_DOUBLE); ap_tolsf = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,NPY_DOUBLE);
ap_tsw = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,PyArray_DOUBLE); ap_tsw = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,NPY_DOUBLE);
ap_nst = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,PyArray_INT); ap_nst = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,NPY_INT);
ap_nfe = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,PyArray_INT); ap_nfe = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,NPY_INT);
ap_nje = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,PyArray_INT); ap_nje = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,NPY_INT);
ap_nqu = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,PyArray_INT); ap_nqu = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,NPY_INT);
ap_mused = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,PyArray_INT); ap_mused = (PyArrayObject *)PyArray_SimpleNew(1,&out_sz,NPY_INT);
if (ap_hu == NULL || ap_tcur == NULL || ap_tolsf == NULL || ap_tsw == NULL || ap_nst == NULL || ap_nfe == NULL || ap_nje == NULL || ap_nqu == NULL || ap_mused == NULL) goto fail; if (ap_hu == NULL || ap_tcur == NULL || ap_tolsf == NULL || ap_tsw == NULL || ap_nst == NULL || ap_nfe == NULL || ap_nje == NULL || ap_nqu == NULL || ap_mused == NULL) goto fail;
} }


Expand Down
94 changes: 47 additions & 47 deletions scipy/integrate/__quadpack.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ static PyObject *quadpack_qagse(PyObject *dummy, PyObject *args) {
QUAD_INIT_FUNC(fcn,extra_args) QUAD_INIT_FUNC(fcn,extra_args)


/* Setup iwork and work arrays */ /* Setup iwork and work arrays */
ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_INT); ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_INT);
ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
if (ap_iord == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL) goto fail; if (ap_iord == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL) goto fail;
iord = (int *)ap_iord->data; iord = (int *)ap_iord->data;
alist = (double *)ap_alist->data; alist = (double *)ap_alist->data;
Expand Down Expand Up @@ -220,11 +220,11 @@ static PyObject *quadpack_qagie(PyObject *dummy, PyObject *args) {
QUAD_INIT_FUNC(fcn,extra_args); QUAD_INIT_FUNC(fcn,extra_args);


/* Setup iwork and work arrays */ /* Setup iwork and work arrays */
ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_INT); ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_INT);
ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
if (ap_iord == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL) goto fail; if (ap_iord == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL) goto fail;
iord = (int *)ap_iord->data; iord = (int *)ap_iord->data;
alist = (double *)ap_alist->data; alist = (double *)ap_alist->data;
Expand Down Expand Up @@ -306,21 +306,21 @@ static PyObject *quadpack_qagpe(PyObject *dummy, PyObject *args) {


QUAD_INIT_FUNC(fcn,extra_args) QUAD_INIT_FUNC(fcn,extra_args)


ap_points = (PyArrayObject *)PyArray_ContiguousFromObject(o_points, PyArray_DOUBLE, 1, 1); ap_points = (PyArrayObject *)PyArray_ContiguousFromObject(o_points, NPY_DOUBLE, 1, 1);
if (ap_points == NULL) goto fail; if (ap_points == NULL) goto fail;
npts2 = ap_points->dimensions[0]; npts2 = ap_points->dimensions[0];
npts2_shape[0] = npts2; npts2_shape[0] = npts2;
points = (double *)ap_points->data; points = (double *)ap_points->data;


/* Setup iwork and work arrays */ /* Setup iwork and work arrays */
ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_INT); ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_INT);
ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_pts = (PyArrayObject *)PyArray_SimpleNew(1,npts2_shape,PyArray_DOUBLE); ap_pts = (PyArrayObject *)PyArray_SimpleNew(1,npts2_shape,NPY_DOUBLE);
ap_level = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_level = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_ndin = (PyArrayObject *)PyArray_SimpleNew(1,npts2_shape,PyArray_DOUBLE); ap_ndin = (PyArrayObject *)PyArray_SimpleNew(1,npts2_shape,NPY_DOUBLE);
if (ap_iord == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL || ap_pts == NULL || ap_level == NULL || ap_ndin == NULL) goto fail; if (ap_iord == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL || ap_pts == NULL || ap_level == NULL || ap_ndin == NULL) goto fail;
iord = (int *)ap_iord->data; iord = (int *)ap_iord->data;
alist = (double *)ap_alist->data; alist = (double *)ap_alist->data;
Expand Down Expand Up @@ -412,26 +412,26 @@ static PyObject *quadpack_qawoe(PyObject *dummy, PyObject *args) {
QUAD_INIT_FUNC(fcn,extra_args) QUAD_INIT_FUNC(fcn,extra_args)


if (o_chebmo != NULL) { if (o_chebmo != NULL) {
ap_chebmo = (PyArrayObject *)PyArray_ContiguousFromObject(o_chebmo, PyArray_DOUBLE, 2, 2); ap_chebmo = (PyArrayObject *)PyArray_ContiguousFromObject(o_chebmo, NPY_DOUBLE, 2, 2);
if (ap_chebmo == NULL) goto fail; if (ap_chebmo == NULL) goto fail;
if (ap_chebmo->dimensions[1] != maxp1 || ap_chebmo->dimensions[0] != 25) if (ap_chebmo->dimensions[1] != maxp1 || ap_chebmo->dimensions[0] != 25)
PYERR(quadpack_error,"Chebyshev moment array has the wrong size."); PYERR(quadpack_error,"Chebyshev moment array has the wrong size.");
} }
else { else {
sz[0] = 25; sz[0] = 25;
sz[1] = maxp1; sz[1] = maxp1;
ap_chebmo = (PyArrayObject *)PyArray_SimpleNew(2,sz,PyArray_DOUBLE); ap_chebmo = (PyArrayObject *)PyArray_SimpleNew(2,sz,NPY_DOUBLE);
if (ap_chebmo == NULL) goto fail; if (ap_chebmo == NULL) goto fail;
} }
chebmo = (double *) ap_chebmo->data; chebmo = (double *) ap_chebmo->data;


/* Setup iwork and work arrays */ /* Setup iwork and work arrays */
ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_INT); ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_INT);
ap_nnlog = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_INT); ap_nnlog = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_INT);
ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
if (ap_iord == NULL || ap_nnlog == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL) goto fail; if (ap_iord == NULL || ap_nnlog == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL) goto fail;
iord = (int *)ap_iord->data; iord = (int *)ap_iord->data;
nnlog = (int *)ap_nnlog->data; nnlog = (int *)ap_nnlog->data;
Expand Down Expand Up @@ -520,20 +520,20 @@ static PyObject *quadpack_qawfe(PyObject *dummy, PyObject *args) {


sz[0] = 25; sz[0] = 25;
sz[1] = maxp1; sz[1] = maxp1;
ap_chebmo = (PyArrayObject *)PyArray_SimpleNew(2,sz,PyArray_DOUBLE); ap_chebmo = (PyArrayObject *)PyArray_SimpleNew(2,sz,NPY_DOUBLE);
if (ap_chebmo == NULL) goto fail; if (ap_chebmo == NULL) goto fail;
chebmo = (double *) ap_chebmo->data; chebmo = (double *) ap_chebmo->data;


/* Setup iwork and work arrays */ /* Setup iwork and work arrays */
ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_INT); ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_INT);
ap_nnlog = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_INT); ap_nnlog = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_INT);
ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_rslst = (PyArrayObject *)PyArray_SimpleNew(1,limlst_shape,PyArray_DOUBLE); ap_rslst = (PyArrayObject *)PyArray_SimpleNew(1,limlst_shape,NPY_DOUBLE);
ap_erlst = (PyArrayObject *)PyArray_SimpleNew(1,limlst_shape,PyArray_DOUBLE); ap_erlst = (PyArrayObject *)PyArray_SimpleNew(1,limlst_shape,NPY_DOUBLE);
ap_ierlst = (PyArrayObject *)PyArray_SimpleNew(1,limlst_shape,PyArray_INT); ap_ierlst = (PyArrayObject *)PyArray_SimpleNew(1,limlst_shape,NPY_INT);
if (ap_iord == NULL || ap_nnlog == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL || ap_rslst == NULL || ap_erlst == NULL || ap_ierlst == NULL) goto fail; if (ap_iord == NULL || ap_nnlog == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL || ap_rslst == NULL || ap_erlst == NULL || ap_ierlst == NULL) goto fail;
iord = (int *)ap_iord->data; iord = (int *)ap_iord->data;
nnlog = (int *)ap_nnlog->data; nnlog = (int *)ap_nnlog->data;
Expand Down Expand Up @@ -625,11 +625,11 @@ static PyObject *quadpack_qawce(PyObject *dummy, PyObject *args) {
QUAD_INIT_FUNC(fcn,extra_args) QUAD_INIT_FUNC(fcn,extra_args)


/* Setup iwork and work arrays */ /* Setup iwork and work arrays */
ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_INT); ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_INT);
ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
if (ap_iord == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL) goto fail; if (ap_iord == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL) goto fail;
iord = (int *)ap_iord->data; iord = (int *)ap_iord->data;
alist = (double *)ap_alist->data; alist = (double *)ap_alist->data;
Expand Down Expand Up @@ -708,11 +708,11 @@ static PyObject *quadpack_qawse(PyObject *dummy, PyObject *args) {
QUAD_INIT_FUNC(fcn,extra_args) QUAD_INIT_FUNC(fcn,extra_args)


/* Setup iwork and work arrays */ /* Setup iwork and work arrays */
ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_INT); ap_iord = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_INT);
ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_alist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_blist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_rlist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,PyArray_DOUBLE); ap_elist = (PyArrayObject *)PyArray_SimpleNew(1,limit_shape,NPY_DOUBLE);
if (ap_iord == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL) goto fail; if (ap_iord == NULL || ap_alist == NULL || ap_blist == NULL || ap_rlist == NULL || ap_elist == NULL) goto fail;
iord = (int *)ap_iord->data; iord = (int *)ap_iord->data;
alist = (double *)ap_alist->data; alist = (double *)ap_alist->data;
Expand Down
8 changes: 4 additions & 4 deletions scipy/integrate/multipack.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ the result tuple when the full_output argument is non-zero.


#define SET_DIAG(ap_diag,o_diag,mode) { /* Set the diag vector from input */ \ #define SET_DIAG(ap_diag,o_diag,mode) { /* Set the diag vector from input */ \
if (o_diag == NULL || o_diag == Py_None) { \ if (o_diag == NULL || o_diag == Py_None) { \
ap_diag = (PyArrayObject *)PyArray_SimpleNew(1,&n,PyArray_DOUBLE); \ ap_diag = (PyArrayObject *)PyArray_SimpleNew(1,&n,NPY_DOUBLE); \
if (ap_diag == NULL) goto fail; \ if (ap_diag == NULL) goto fail; \
diag = (double *)ap_diag -> data; \ diag = (double *)ap_diag -> data; \
mode = 1; \ mode = 1; \
} \ } \
else { \ else { \
ap_diag = (PyArrayObject *)PyArray_ContiguousFromObject(o_diag, PyArray_DOUBLE, 1, 1); \ ap_diag = (PyArrayObject *)PyArray_ContiguousFromObject(o_diag, NPY_DOUBLE, 1, 1); \
if (ap_diag == NULL) goto fail; \ if (ap_diag == NULL) goto fail; \
diag = (double *)ap_diag -> data; \ diag = (double *)ap_diag -> data; \
mode = 2; } } mode = 2; } }
Expand Down Expand Up @@ -154,7 +154,7 @@ static PyObject *call_python_function(PyObject *func, npy_intp n, double *x, PyO
PyArrayObject *result_array = NULL; PyArrayObject *result_array = NULL;


/* Build sequence argument from inputs */ /* Build sequence argument from inputs */
sequence = (PyArrayObject *)PyArray_SimpleNewFromData(1, &n, PyArray_DOUBLE, (char *)x); sequence = (PyArrayObject *)PyArray_SimpleNewFromData(1, &n, NPY_DOUBLE, (char *)x);
if (sequence == NULL) PYERR2(error_obj,"Internal failure to make an array of doubles out of first\n argument to function call."); if (sequence == NULL) PYERR2(error_obj,"Internal failure to make an array of doubles out of first\n argument to function call.");


/* Build argument list */ /* Build argument list */
Expand Down Expand Up @@ -185,7 +185,7 @@ static PyObject *call_python_function(PyObject *func, npy_intp n, double *x, PyO
goto fail; goto fail;
} }


if ((result_array = (PyArrayObject *)PyArray_ContiguousFromObject(result, PyArray_DOUBLE, dim-1, dim))==NULL) if ((result_array = (PyArrayObject *)PyArray_ContiguousFromObject(result, NPY_DOUBLE, dim-1, dim))==NULL)
PYERR2(error_obj,"Result from function call is not a proper array of floats."); PYERR2(error_obj,"Result from function call is not a proper array of floats.");


Py_DECREF(result); Py_DECREF(result);
Expand Down
Loading

0 comments on commit 8fce1e6

Please sign in to comment.