Hi Chris,

Have you looked at the PyUblas <http://mathema.tician.de/software/pyublas> library? This provides a neat interface to C++ with Numpy arrays. On the C++ side you end up with a class that inherits from boost::ublas::matrix, which does no data copying, and which has a nice interface. You can get a pointer to the underlying data as well.

You'd still need to wrap your original class, but those wrapper functions would be simpler.
Let me know if you need help.
Garth


[email protected] wrote:
From: "Christopher A Mejia" <[email protected]>

Hi,

I've been trying to do something that is I would think is a very common
task: I'm trying to expose to Python a C++ class with a member function that
inputs an array of data.  On the Python side, I would like to use NumPy to
store this array of data.  I've spent many hours searching online for a
simple example, but haven't found one.
<snip>
_______________________________________________
Cplusplus-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to