[Numpy-discussion] New arrays in 1.6 not always C-contiguous

Frédéric Bastien nouiz at nouiz.org
Tue Jul 12 12:25:42 EDT 2011


Hi,

We depend highly on numpy, but don't have the time to follow all the
mailing lists regularly of all our tools. Having some information on
the release note about this would have been useful to many people I
think.

Also, did this affect the C-API? Do the default value of newlly
created ndarray in C changed?

Thanks for the great work.

Frédéric Bastien

On Fri, Jul 8, 2011 at 12:50 PM, Sturla Molden <sturla at molden.no> wrote:
> Den 07.07.2011 14:10, skrev Jens Jørgen Mortensen:
>> So, this means I can't count on new arrays being C-contiguous any more.
>> I guess there is a good reason for this.
>
> Work with linear algebra (LAPACK) caused excessive and redundant array
> transpositions. Arrays would be transposed from C to Fortran order
> before they were passed to LAPACK, and returned arrays were transposed
> from Fortran to C order when used in Python. Signal and image processing
> in SciPy (FFTPACK) suffered from the same issue, as did certain
> optimization (MINPACK). Computer graphics with OpenGL was similarly
> impaired. The OpenGL library has a C frontent, but requires that all
> buffers and matrices are stored in Fortran order.
>
> The old behaviour of NumPy was very annoying. Now we can rely on NumPy
> to always use the most efficient memory layout, unless we request one in
> particular.
>
> Yeah, and it also made NumPy look bad compared to Matlab, which always
> uses Fortran order for this reason ;-)
>
> Sturla
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



More information about the NumPy-Discussion mailing list