[Numpy-discussion] ANN: numpy.i - added managed deallocation to ARGOUTVIEW_ARRAY1 (ARGOUTVIEWM_ARRAY1)
Thu Jan 8 10:22:19 CST 2009
I've moved my wiki to the scipy cookbook:
For the time being, the listed example files are still stored on the google
code SVN, but these could easily be moved if necessary.
I've also just finished adding an ARGOUTVIEWM_ARRAY2 example. The example
shows how to return a two-dimensional array from C which also benefits from
the automatic memory deallocation.
A naive "crop" function is wrapped using SWIG/numpy.i and returns a slice of
the input array. When used as
array_out = crop.crop(array_in, d1_0,d1_1, d2_0,d2_1)
it is equivalent to the native numpy slicing
array_out = array_in[d1_0:d1_1, d2_0:d2_1]
Hope this helps!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion