Re: [Numpy-discussion] PyArray_FromDimsAndData weird seg fault

2007-05-03 Thread Travis Oliphant
Trevor M Cickovski wrote: > Hi, > > I'm using SWIG to wrap a function that calls the NumPy routine > PyArray_FromDimsAndData. > > PyObject* toArray() { > int dims = 5; > double* myH; > myH = (double*)malloc(dims*sizeof(double)); > myH[0] = 0; myH[1] = 1; myH[2] = 2; myH[3] = 3;

[Numpy-discussion] PyArray_FromDimsAndData weird seg fault

2007-05-03 Thread Trevor M Cickovski
Hi, I'm using SWIG to wrap a function that calls the NumPy routine PyArray_FromDimsAndData. PyObject* toArray() { int dims = 5; double* myH; myH = (double*)malloc(dims*sizeof(double)); myH[0] = 0; myH[1] = 1; myH[2] = 2; myH[3] = 3; myH[4] = 4; return PyArray_FromDimsAnd