[SciPy-dev] numpy API help

Neal Becker ndbecker2 at gmail.com
Fri Mar 10 12:17:46 CST 2006


I need some help with numpy-0.9.5.  I don't really have any API docs, so
maybe that's my problem.

#include <Python.h>
#include <arrayobject.h>


int main() {
  intp dims[1];
  dims[0] = 2;
  PyObject* o = PyArray_SimpleNew (1, dims, PyArray_INT);
}
(gdb) run
Starting program: /home/nbecker/Test 

Program received signal SIGSEGV, Segmentation fault.
0x0000000000400525 in main () at Test.cc:8

I notice that the precompiled output is:
int main() {
  intp dims[1];
  dims[0] = 2;
  PyObject* o = (*(PyObject * (*)(PyTypeObject *, int, intp *, int, intp *,
void *, int, int, PyObject *)) PyArray_API[82])(&(*(PyTypeObject
*)PyArray_API[1]), 1, dims, PyArray_INT, __null, __null, 0, 0, __null);
}





More information about the Scipy-dev mailing list