[SciPy-user] Confusing BLAS/LAPACK situation on Mac OS X

Travis Oliphant oliphant.travis at ieee.org
Sat Jan 28 17:23:57 CST 2006


Arnd Baecker wrote:

>With numpy
>  mat = zeros((Ny, Nx), fortran=1)
>should do the job (I have not tested this yet).
>
>If all the above is correct, then the solution I would use
>for myself is to set `fortran=1` for all arrays which
>will be used by some LAPACK routine.
>Then no unnecessary copies of (presumably large) arrays will take
>place on any machine and one could stop worrying about flapack
>vs. clapack ;-).
>
>Not sure if that is the solution for everyone - so I am happy
>to learn about any drawbacks....
>  
>
This is the main purpose of the Fortran-order arrays in NumPy --- 
optimize interfaces to Fortran-written packages.   Right now, 
C-contiguous arrays still have a "special place" because several 
algorithms require C-contiguous arrays in order to work and will make 
copies of Fortran-order arrays as needed.  

There may still be some issues with these Fortran-order arrays 
especially regarding un-needed copying.  With Numeric, f2py did an 
intelligent job of deciding whether or not to copy.  Most of this is 
unneeded now because the FORTRAN flag on the NumPy array is kept 
up-to-date with the striding information on the NumPy array so that you 
just need to look at that flag to determine if the array is in 
Fortran-order or not. 

-Travis




More information about the SciPy-user mailing list