"Samuel" == Samuel GARCIA <sgarcia@olfac.univ-lyon1.fr> writes:
Samuel> Hi, how to resize a array in the c++ code with
Samuel> weave.inline()
[...]
Samuel> c = ones((3,6))
[...]
Samuel> err = weave.inline(code, ['c'], type_converters=converters.blitz)
Samuel> print c.shape #I want (4,7) !!!
I am not sure why you'd want to do that. Can't you resize it from
Python? In any case, if you really must do it, take a look at the c++
code generated by weave and look at it. You'll see that c_array is a
PyArrayObject that you can use if you want it. However, I am not sure
what will happen if you do resize the array and are using blitz. I
suspect something bad may happen. Resizing the array might also
relocate the entire block of memory for the array so accessing the
older pointer will likely be disastrous. So, you should be careful
doing this.
cheers,
prabhu
_______________________________________________
SciPy-user mailing list
SciPy-user@scipy.net
http://www.scipy.net/mailman/listinfo/scipy-user