Dear all,

For my Krylov subspace basis build up, I am doing some sparse matrix - dense matrix multiplications. That is fine. I use mkl_dcsrmm for this. But the question now is I am keeping my Krylov vectors in a

std::vector

conceptually, the vectors are the columns of my dense matrix. However, the above interface is considering all the matrices in row major order, is there a way to change this. Since I keep my basis in an array of arrays, I should somehow make it interpreted colum-wise. Is there a work around for this? Or both matrix ordering should be the same when using the routine so one could not be row major(the sparse matrix) and the dense matrix, column major? This is far more efficient and easy to use if there is a work-around for this task.

For instance for the below simple code, I would like b to be interpreted column wise not row-wise while a is still row-wise.

int main()

{

double a[] = {1.e0,2.e0,3.e0};

int ia[] = {0,1,2,3};

int ja[] = {0,1,2};

double b[] = {1.e0,4.e0,2.e0,5.e0,3.e0,6.e0};

double c[] = {0,0,0,0,0,0};

MKL_INT m = 3;

MKL_INT k= 3;

MKL_INT n = 2;

double alpha = 1.0;

double beta = 0.0;

//

char matdescra[6];

matdescra[0]= 'g';

matdescra[1]= 'l';

matdescra[2]= 'u';

matdescra[3]= 'c';

char transa = 'N';

mkl_dcsrmm(&transa,

&m, &n, &k,

&alpha,

matdescra,

a, ja, ia,

ia+1, b,

&n, &beta, c, &n);

//

for(int z=0;z<6;z++)

std::cout << c[z] << std::endl;

return 0;

}