[Numpy-discussion] swig numpy2carray converters

Christopher Barker Chris.Barker@noaa....
Wed Nov 21 11:32:19 CST 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.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

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@noaa.gov


More information about the Numpy-discussion mailing list