[LAPACKE_dgesv problem] no resuls for dynamic arrays

Open discussion regarding features, bugs, issues, vendors, etc.

[LAPACKE_dgesv problem] no resuls for dynamic arrays

Postby aliraeli » Thu Nov 20, 2014 7:09 am

Hello everybody.

I'm working with the LAPCKE_dgesv and i tried lots of different solutions but i've not output vectors with the solution.
I defined my matrix and constants as below:
Code: Select all
   MKL_INT IPIV[nocts];
    MKL_INT nocts1;
    nocts1=nocts;
    MKL_INT INFO;
    MKL_INT NRHS;
    NRHS=1;
    INFO=2;
    double *Mat;
    double *b;
    Mat=(double *)malloc(sizeof(double)*nocts1*nocts1);
    b=(double*)malloc(sizeof(double)*nocts1);
    if(Mat==NULL)printf("bad allocation Mat");
    if(b==NULL)printf("bad allocation b");


and i checked that the memory is contiguos for both Mat and b;
then i put the values calculated from other matrices that i need to preserve (everytime defined with malloc)

Code: Select all
    for(int i=0;i<nocts1;i++){
      b[i]=Right[i];
      for(int j =0; j<nocts1;j++){
   Mat[i*nocts1+j]=Matrix[i*nocts1+j];
      }
    }


i checked that b and Mat received the good values and they are in output identical to Right and Mat.
That's the moment i can try to solve my linear system calling

Code: Select all
INFO=LAPACKE_dgesv(LAPACK_ROW_MAJOR, nocts1, NRHS, Mat, nocts1, IPIV, b, nocts1);


and then? nothing.
INFO changes value to 0, so i can thing the system is solved, Mat changes its values so i can think it worked but b, my foundamental output, it's everytime the same before and after (obviously my matrix is not identical and i tried a small nocts1 examples with mahematica so i know the solution that i expect)

What happens to my solution?

If you can help i appreciate.
aliraeli
 
Posts: 1
Joined: Thu Nov 20, 2014 6:54 am

Return to User Discussion

Who is online

Users browsing this forum: Google [Bot] and 6 guests

cron