Congrats for successfully using DGEQR2!
Note that if you go to larger size you will want to use DGEQRF which uses level
3 BLAS in conjunction with an optimized BLAS routines.
But if you are happy with your time to solution keep it like that. For 4x3, you
are just fine.
To extract Q, you need to use DORGQR. Please read the doc and come back to us
Note that some times you do not want Q but you want to apply Q to a bunch of
vectors, in which case,
it is better to use DORMQR.
Of course you can first compute Q with DORGQR and then apply Q by a straight
matrix-matrix multiplication, but this is less efficient (in general) than
Of course you can first compute Q with DORMQR by applying DORMQR to the
identity, but this is less efficient (in general) than DORGQR.
On Sep 27, 2012, at 2:27 PM, Roy P Koomullil
I am trying to use DGEQR2 to calculate QR factorization of a rectangular
matrix. I was able to compile the library and run it with a simple 4x3 case. I
also could see R (which is the upper triangular portion of A on exit).
However, I am having some issue on extracting Q from the matrix.
In the documentation it is written that Q is the product of elementary
reflectors (H(1)H(2)?H(k)), where H(i) = I ? tau*v*v_transpose and v is stored
in the lower triangular portion of A on exit. This involves a lot of
calculations outside the library. Is there any easier way to calculate Q? I am
not sure about what are the properties of elementary reflectors and properties
of v, we can use to simplify the calculations.
Any help in this matter will be greatly appreciated.
Phone: (205)-934-0832 /Fax:(205)-975-7244 1720
Second Ave South
Birmingham, AL 35294
Lapack mailing list
-------------- next part --------------
An HTML attachment was scrubbed...