On using dgglse_

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

On using dgglse_

Postby kyewong » Sun Sep 06, 2009 11:18 pm

Why dgglse_ doesn't support multi-column matrix on its right hand side,like dgels_

for example:for the equation Ax=B
In dgels_, B could be of multi-column, so A just needs to be factorized only once
But in dgglse_, if I want to solve the following problem:
1 minimize || c1 - A*x ||_2 subject to B*x = d1
2 minimize || c2- A*x ||_2 subject to B*x = d2
3 minimize || c3- A*x ||_2 subject to B*x = d3
...
I could only solve them one by one, in this case,the same (A,B) must be factorized multiple times, which wastes a lot of time.
Could anyone give a better solution pls?
Or what's the rational of dgglse_ comparing to dgels_ ?
Thanks!
kyewong
 
Posts: 8
Joined: Fri Aug 28, 2009 4:10 am

Re: On using dgglse_

Postby Julien Langou » Mon Sep 07, 2009 11:50 am

DGGLSE supports only "one c" and "one d". Since most of the work is in the factorization of the matrices, you are perfectly right that if you have "several c" and "several d", then the interface is not optimal at all. I can put your request on the wish list of LAPACK functionality. It makes complete sense to have the functionality if someone wants it. (The converse is true as well: It would not have made much sense to have the functionality if nobody wants it ... ) Can you send a brief description of your application and why you need this functionality please?

It should be fairly easy to "hack" DGGLSE so that it supports K couples (c,d). I believe all you need to do is to insert a DO loop from line 196 to line 260 of DGGLSE, where the code would loop on each couple (c,d) one at a time. That would be the first step. The second step would be to group the LAPACK function calls so that they handle all the couple (c,d) at once. For example, the first call to DORMQR line 200. You can call K times DORMQR( 'L', 'T', M, 1, MN, ... ) -- this is what you would do with the DO loop -- or you call it once with DORMQR( 'L', 'T', M, K, MN, ... ). Them the same for DTRTRS line 207. Instead of calling K times DTRTRS( 'U', 'N', 'N', P, 1, ...), one would call once DTRTRS( 'U', 'N', 'N', P, K, ... ). Etc.

Julien
Julien Langou
 
Posts: 733
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: On using dgglse_

Postby Julien Langou » Mon Sep 07, 2009 12:26 pm

Congratulations. You have been added to the LAPACK wishlist. See: http://www.netlib.org/lapack/WishList/.
Feel free to provide insight on why the functionality would be useful to you or to others. (Application, etc.)
Julien Langou
 
Posts: 733
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: On using dgglse_

Postby kyewong » Tue Sep 08, 2009 1:55 am

Hi Julien
Thanks for ur help and detailed explanation!
However, I believe that most users of LAPACK are intereseted in how to "use" the library instead of how to "maintain" or "develop" it, so could u pls attach the modified version (both the .h and .c files) here directly such that we don't need to spend time on going through the code?
kyewong
 
Posts: 8
Joined: Fri Aug 28, 2009 4:10 am

Re: On using dgglse_

Postby charisse090 » Thu Sep 17, 2009 11:08 pm

Yeah, I am thankful too..it really helps.
charisse090
 
Posts: 1
Joined: Thu Sep 17, 2009 10:32 pm


Return to User Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest