## Another output for QR factorization than in example

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

### Another output for QR factorization than in example

Hello,

when i tried to implement the QR factorization example as described in the IBM Example: http://www.cepba.upc.edu/docs/ibm_doc/m ... sl368.html

i get another output for the Matrix R than they show on this page.
My code is:

Code: Select all
`    double *A1,*work,*tau;      A1 = (double*)calloc(12,sizeof(double));            A1 = 0.0;    A1 = 2.0;    A1 = 2.0;    A1 = 0.0;    A1 = 2.0;    A1 = 2.0;    A1 = 2.0;    A1 = -1.0;    A1 = -1.0;    A1 = 1.0;    A1 = -1.0;    A1 = -1.0;            int m = 6;    int n = 2;    int lda = 6;        work = (double*)calloc(2,sizeof(double));    tau  = (double*)calloc(2,sizeof(double));        int lwork = 2;    int info;                for(int i=0; i < 12; i++){            printf("%f \n",A1[i]);              }    printf("------------------------------------------------------------\n");        dgeqrf_(&m,&n,A1,&m,tau,work,&n,&info);           for(int i=0; i < 12; i++){            printf("%f \n",A1[i]);    }    printf("------------------------------------------------------------\n");`

And my output is:

Code: Select all
`-4.00.50.50.00.50.52.02.2360680.309017-0.3090170.3090170.309017`

Can anybody say where my problem is?
Mat

Posts: 47
Joined: Sat Aug 19, 2006 9:54 am

Hello Mat,
what about setting A(4,2) (i.e. A1) to 1.5 as in IBM ESSL example?
(You have set it to 1.0.)
Julie
Julie

Posts: 299
Joined: Wed Feb 23, 2005 12:32 am

:oops:

sorry - after about 2 hours of checking if i really used the correct matrix A it seems i was blind yesterday evening. Thanks a lot.
The next time i will go to sleep if i can't see the forest because of the trees...*grmpf.

Thanks for your patient help again.
Mat

Posts: 47
Joined: Sat Aug 19, 2006 9:54 am 