The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

dlarf correct, zlarf incorrect? Why?

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

dlarf correct, zlarf incorrect? Why?

Postby Mat » Sun Sep 16, 2007 8:02 pm

Hello,

i want to use dlarf and zlarf after a qr-decomposition. With dlarf everything works correct, but with zlarf the output is incorrect for some matrices.

My dlarf method looks this:

Code: Select all
   char * side = "L";
   double* work = new double[n];
   double diag;
   memset(work, 0, n * sizeof(double));
   double tau_i;
   int dlarf;

   for(int i = 0; i < n; i++)
   {
      tau_i = tau[i];
      dlarf = m - i;
      diag = *A;
      *A  = 1;
      dlarf_(side, &dlarf, &one, A, &one, &tau_i, ek, &m, work);
      *A = diag;
      ek++;
      A += (m + 1);
   }


my zlarf method looks this: Its the same procedure only with a structure COMPLEX

Code: Select all
   COMPLEX c_one;

   c_one.real = 1.0;
   c_one.imag = 0.0;

   char * side = "L";
   COMPLEX* work = new COMPLEX[n];
   COMPLEX diag;
   memset(work, 0, n * sizeof(COMPLEX));
   COMPLEX tau_i;
   int dlarf;

   for(int i = 0; i < n; i++)
   {
      tau_i = tau[i];
      dlarf = m - i;
      diag = *A;
      *A  = c_one;
      zlarf_(side,
         &dlarf,
         &one,
         A,
         &one,
         &tau_i,
         ek,
         &m,
         work);
      *A = diag;
      ek++;
      A += (m + 1);
   }


why does dlarf produce correct and zlarf incorrect results? If i use zunmqr instead of zlarf everything is correct. But i need zlarf because my zunmqr and dormqr methods produces for some input seg-faults.
Mat
 
Posts: 47
Joined: Sat Aug 19, 2006 9:54 am

Return to User Discussion

Who is online

Users browsing this forum: No registered users and 4 guests