Hi,
I'm having a little Problem that might be trivial.
I'm trying to use a nupmy array within a c++ method and having some trouble.
The PyArray is not parsed correctly and PyArg_ParseTuple returns 0.
Appreciate any help.

#include "Python.h"
#include <numpy/arrayobject.h>

void fromMatrix(PyObject *args){
    _import_array();
    PyArrayObject* A;
    PyArrayObject* B;
    if (!PyArg_ParseTuple(args, "O!O!", &PyArray_Type,&A, &PyArray_Type,&B))
        return;

    int m = PyArray_DIM(A,0);
    int n = PyArray_DIM(A,1);

.... and so on.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to