[Numpy-discussion] swig numpy2carray converters

Christopher Barker Chris.Barker at noaa.gov
Wed Nov 21 12:32:19 EST 2007

Georg Holzmann wrote:
> As chris said, I need to make an example:
> http://grh.mur.at/software/numpy2carray.tar.gz

Ah, I see now:

   /// @return internal big data without copying
   void getBigData(double **mtx, int *rows, int *cols)
     *rows = drows; *cols = dcols;
     *mtx = very_big_data;

This is the one we've been talking about, correct?

So you need to pass a pointer to a pointer in, and it gets set to the 
existing pointer -- thus no new data allocation.

It's going to take Bill to figure out how to extend numpy.i to cover 
this case, but imagine it will be pretty straightforward.

Thanks for the examples.


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov

More information about the NumPy-Discussion mailing list