Chris Colbert wrote:
> Since I have a "cimport numpy as np" at the top of my cython file,
>
> array1.shape == array2.shape
>
> is only true if array1 IS array2 because .shape return the npy_intp*
> pointer to the shape array.
>
> Is there a way for me check if the values in the shape array are equal
> (ala python) without having to drop into a loop?
How about casting the arrays to object, so you get a dictionary lookup 
on the shape attribute? Very slow though...

Or write a cdef that takes two ndarrays as argument and returns 1 if the 
shapes are equal?

Or assuming equal rank, simply use C library function memcmp from string.h?

S.M.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to