Dag Sverre Seljebotn wrote:

> The usual way is to check a.flags['C_CONTIGUOUS'], although this tends 
> to be a bit too conservative sometimes (arrays which are contiguous are 
> not flagged as such; that's a problem with NumPy).

You keep referring to a.flags['C_CONTIGUOUS'] but it seems to me it
should be (<object>a).flags["C_CONTIGUOUS"].

Using a.flags['C_CONTIGUOUS'] will give an invalid index error since
a.flags is stored as an int (at least in my Cython 0.11 version).

Btw, to enforce contiguous arrays what I've done was to place this
condition in my Cython function:

if not (<object>a).flags["C_CONTIGUOUS"]:
    a = a.copy('C')


Cheers,

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

Reply via email to