Hello list,

I've moved my wiki to the scipy cookbook: http://www.scipy.org/Cookbook/SWIG_Memory_Deallocation

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!

Regards,
Egor