Hi,

I have C++ module (OpenGL) that extracts data from numpy arrays. The interface is pure read-only: It never returns any Python objects but only extracts data from numpy arrays. Eg:

#include "numpy/arrayobject.h"

void PrimitiveManager::deleteAtoms(PyObject * numpy_indices)
{
    // Extract number of indices
    int const n = static_cast<int>(PyArray_DIMS(numpy_indices)[0]);
    long * const indices = (long *) PyArray_DATA(numpy_indices);

    // Delete atoms in buffer
    for (int i = 0; i < n; ++i)
    {
        // Do stuff
    }
}

Now, when I compile the code with g++, I get the following warning:

numpy/core/include/numpy/__multiarray_api.h:1532: warning: 'int _import_array()' defined but not used

Do I need to call '_import_array()' somewhere? Am I doing something potentially nasty?

Best regards,

Mads





--
+-----------------------------------------------------+
| Mads Ipsen                                          |
+----------------------+------------------------------+
| Gåsebæksvej 7, 4. tv |                              |
| DK-2500 Valby        | phone:          +45-29716388 |
| Denmark              | email:  [email protected] |
+----------------------+------------------------------+


_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to