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

optimal work size for zgeqrf ?

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

optimal work size for zgeqrf ?

Postby Mat » Fri Aug 24, 2007 12:02 pm

Hello,

it is possible to precompute the optimal work size for a real QR decomposition. It is used with a work = 0.0 input parameter.

Is it possible to precompute an optimal work size for complex input - the zgeqrf ? If so - how the work parameter has to be selected?
Perhaps like this (in C++) ?:

struct Complex {double real; double imag;}
Complex work;
work.real = 1.0;
work.imag = 0.0;

?

Thanks a lot
Mat
 
Posts: 47
Joined: Sat Aug 19, 2006 9:54 am

Postby Julien Langou » Fri Aug 24, 2007 12:05 pm

Look at the second post (mine) at
http://icl.cs.utk.edu/lapack-forum/viewtopic.php?t=478
there is a workspace size query made in C on ZGELSS.
It works exaclty the same with ZGEQRF.
Julien.
Julien Langou
 
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Postby Mat » Fri Aug 24, 2007 12:22 pm

Thanks,

for dgeqrf_ is this a correct optimum computation?:

Code: Select all
int         lwork = -1, info = 0;
         
double   work = 0.0;


   dgeqrf_ (...);
   
   lwork = static_cast< int > (work);
   return lwork;


or would this be a valid optimum size computation as well:

Code: Select all
int lwork = -1;
double* work = NULL;

work = new double[1];
work[0] = 0.0;

dgeqrf_(...);
lwork = (int) work[0];


I'm a bit confused because i want to use a template-based method for this optimum computation both for dobule AND Complex templates...
Mat
 
Posts: 47
Joined: Sat Aug 19, 2006 9:54 am

Postby Julien Langou » Fri Aug 24, 2007 12:28 pm

Both looks fine. Try them, you'll see!
(I have no idea and do not want to know what is that static_cast< int > )
Julien Langou
 
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 4 guests