I have two questions about sgels example:
(1) why need to call sgels twice?
/* Query and allocate the optimal workspace */
lwork = -1;
sgels( "No transpose", &m, &n, &nrhs, a, &lda, b, &ldb, &wkopt, &lwork, &info );
lwork = (MKL_INT)wkopt;
work = (float*)malloc( lwork*sizeof(float) );
/* Solve the equations A*X = B */
sgels( "No transpose", &m, &n, &nrhs, a, &lda, b, &ldb, work, &lwork, &info );
(2) where to decide row-major matrix or column -major matrix?
Thank you very much!