#include "Python.h" #include "arrayobject.h" #include #include #define IDATA(p) ((int *) (((PyArrayObject *)p)->data)) #define DDATA(p) ((double *) (((PyArrayObject *)p)->data)) static PyObject *py_change_array(PyObject *self, PyObject *args); static PyObject *py_change_array(PyObject *self, PyObject *args){ int n,ok,i; PyObject *xarray; double *x; ok = PyArg_ParseTuple(args,"iO",&n,&xarray); if (!ok){ fprintf(stderr,"Error (change_array) in parsing arguments\n"); exit(1); } x = DDATA(xarray); for (i=0;i