Hello,
I'm using LAPACKE_dgetrf to compute the LU factorization of square matrices in double precision. The matrix is in column major. Here is what I am doing. The environment is MKL 2018 Update 3 for Windows + Visual studio 2017.
for(...)
{
lapack_int m = dim; //dim is around 40 to 80
double * A = (double*)mkl_malloc(m * m * sizeof(double), 64);
memcpy(A, source, m * m * sizeof(double));
lapack_int * ipiv = (lapack_int*)mkl_malloc(m * sizeof(lapack_int), 64);
lapack_int info = 0;
int mat_layout = LAPACK_COL_MAJOR;
for(int k = 0; k < m; k++) //flush ipiv before calling dgetrf
ipiv[k] = -1;
info = LAPACKE_dgetrf(mat_layout, m, m, A, m, ipiv);
if(info != 0)
{clean up memory;
break;}
}
I checked the info that was returned by LAPACKE_dgetrf and it was always 0. However, I found out I got duplicate items in ipiv array after each dgetrf call.
I mean I got ipiv[i] == ipiv[j] (0 < i , j < m), which doesn't make sense for partial pivoting. I also flushed the ipiv array before calling dgetrf.
What is the possible reason for getting duplicate values in partial pivoting array?
Thank you.