[Numpy-discussion] PyArray_DIMS problem
Sebastian Haase
haase at msg.ucsf.edu
Wed Dec 20 21:43:28 CST 2006
On 12/20/06, Gennan Chen <gnchen at mac.com> wrote:
> Hi!
>
>
> I have problem with this function call under FC6 X86_64 for my own numpy
> extension
>
>
> printf("\n %d %d %d",
> PyArray_DIM(imgi,0),PyArray_DIM(imgi,1),PyArray_DIM(imgi,2))
>
>
> it gave me
>
>
> 166 256 256
>
>
> if I tried:
>
>
> int *dim;
> dim = PyArray_DIMS(imgi)
> printf("\n %d %d %d", dim[0], dim[1], dim[2]);
>
>
> it gave me 166 0 256
>
Hi -
maybe I'm dense here -
but how is this /supposed/ to work ? Is PyArray_DIMS allocating some memory
that never gets freed !?
I thought "tuples" in C had to always be passed into a function, so that
that function could modify it, as in:
const int maxNDim = 20;
int dim[maxNDim];
PyArray_DIMS(imgi, dim);
What am I missing ... ?
-Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20061220/f449745b/attachment.html
More information about the Numpy-discussion
mailing list