Page 1 of 1

### On using dgglse_

Posted: 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!

### Re: On using dgglse_

Posted: 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

### Re: On using dgglse_

Posted: 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.)

### Re: On using dgglse_

Posted: 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?

### Re: On using dgglse_

Posted: Thu Sep 17, 2009 11:08 pm
Yeah, I am thankful too..it really helps.

### Re: On using dgglse_

Posted: Tue Aug 19, 2014 1:52 pm
Here is a link to the LAPACK user guide: http://www.netlib.org/lapack/lug/
Hope it helps