[SciPy-dev] Does it worth the trouble to support non contiguous array in C extensions ?

David Cournapeau david at ar.media.kyoto-u.ac.jp
Tue Nov 28 01:10:44 CST 2006


Hi,

    I am about to push in SVN the first version of a small package to 
compute lpc coefficients and lpc residual. I spent most of the time 
trying to understand how to handle non contiguous arrays in various 
parts of the C code...
    Now, I am wondering: does it really worth the trouble ? I noticed 
that most of the time, it is even faster (and obviously much easier to 
code/debug/test, and much more reliable) to just copy the data in a 
contiguous new array before processing with a C function expecting 
contiguous array...
    Is there a general policy regarding thoses issues for scipy ? Is it 
enough to write simple C extensions expecting contiguous arrays, and 
converting input to contiguous layout if necessary ?

    Cheers,

    David


More information about the Scipy-dev mailing list