I'm calling dgetrf
from LAPACK on a row-major matrix, via clapack.h
.
I have the matrix A = [4,9,2; 3,5,7; 8,1,6]
.
If I call dgetrf, the result is [9.0, 0.222222, 0.444444; 5.0, 5.888888, 0.132075; 1.0, 5.777777, 6.792453]
. However, the result should be [8.0, 1.0, 6.0; 0.5, 8.5, -1.0; 0.375, 0.544118, 5.294118]
.
If I instead transpose A prior to calling dgetrf
, and then transpose the output once more, I get the correct result.
The call I'm using is: clapack_dgetrf(CblasRowMajor, 3, 3, A, 3, ipiv);
ipiv
is, of course, an integer array of size 3, and A is an array of doubles, size 9: [4,9,2,3,5,7,8,1,6]
.
I've tried switching the order argument to CblasColMajor
, just in case I'm crazy, and that doesn't work as expected either.
Is this as it should be?