# Impact of frequent row major / column major conversions using LAPACK/BLAS?

If you call a library like LAPACK or BLAS (which are written in FORTRAN and use column major order) from a C-like language that uses row major order, won't you lose performance and use a lot of memory due to the creation of transposed matrices? Tests are best, of course, but can anyone with experience tell me whether optimized libraries still improve performance, even after that overhead?

• I haven't tested the performance penalty, but you might use a library or a toolkit that hides away memory layout. E.g. in NumPy (relevant parts written in C), you can choose the memory layout on array object creation. Aug 12 '14 at 7:00
• If I am not mistaken, BLAS and LAPACK have a "transpose" argument that tells if you want the operation done with $A$ or with $A^T$. So you can effectively pass matrices to BLAS either in row-major or column-major order, you just have to specify it. No explicit transpositions are performed. Of course, some algorithms might perform better with row-major and some with column-major storage, but this seems a different issue. Aug 12 '14 at 12:38