Registered Member
|
How to extract the Q & R matrices for the QR decomposition in Eigen?
|
Registered Member
|
Which QR decomposition are you using? For instance, for ColPivHouseholderQR, looking in the documentation at http://eigen.tuxfamily.org/dox-devel/cl ... derQR.html I can see a method .householderQ() for extracting the Q matrix and .matrixR() for extracting the R matrix. |
Registered Member
|
Thanks. I was using looking at FullPivHouseholderQR(http://eigen.tuxfamily.org/dox-devel/cl ... derQR.html) and HouseholderQR(http://eigen.tuxfamily.org/dox-devel/cl ... derQR.html) and these didn't have the method matrixR(). Thanks again. |
Moderator
|
but they have a matrixQR() from which you can get the R matrix as the upper triangular part:
|
Registered Member
|
Thanks. But looks like all the three methods return a full QR. My matrix is a very thin matrix and I definitely do not want to do full QR. How should I proceed to get a reduced QR factorization? |
Moderator
|
they do a reduced QR by default.
|
Registered Member
|
There is a thread about the thin QR at viewtopic.php?f=74&t=91271 . The code at the end of that thread may be useful for you.
|
Registered Member
|
The question is precisely how to do that? Given a thin matrix A, how to get its thin QR and store the Q and R factors? |
Registered Member
|
I am getting an error Upper was not declared in this scope. Any hints, sorry for being noob. I have included hearder files Eigen/Dense , Eigen/QR Edited: Found the bug, forgot to write in using namespace Eigen; |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]