Re: [eigen] QR factorization question

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


great! that solved my problem.

i have another issue though: A is a skinny matrix (m > n), and the matrix Q is square (m x m).

how do i retrieve the appropriate Q matrix that goes with my (now) upper triangular R? (i.e. A = [Q1 Q2] [R1; 0]--or the "economy size decomposition" in Matlab)

is there some way to figure out what the triangularView call did (what it multiplied matrixQR with to make matrixQR upper triangular) so i can apply it appropriately to the matrixQ and grab the first n columns.

thanks!
eric

On Wed, Aug 26, 2009 at 4:41 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
2009/8/26 Eric Chu <eytchu@xxxxxxxxx>:
> hi all,
> thanks for the great work. i recently updated my version of eigen, and the
> api's changed a bit from before.
> more specifically, the qr factorization module has changed. i was wondering
> how i'd go about retrieving the upper triangular matrix "R" from a qr
> factorization.
> that is, if i have an m x n matrix A, and i call
> R = A.householderQr().matrixR();
> the API seems to have deprecated this function call. i think i can call
> matrixQR() instead, but it's no longer upper triangular. any pointers?

Yes, matrixR() is removed at the moment, we may reintroduce it in the
future though once we support trapezoid matrices.

Meawhile you can retrive R as the upper triangular part of matrixQR().

R = A.householderQr().matrixQR().triangularView<UpperTriangular>();

Benoit





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/