[eigen] How to obtain the matrices Q and R of a QR decomposition

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


Hi,

using Eigen 3 I would expect the following code to give me Q and R:

    MatrixXcd A = MatrixXcd::Random(m,m), Q, R;
    HouseholderQR<MatrixXcd> hh(A);

    // MATLAB economy size QR decomp.: [Q,R] = qr( A, 0 );
    Q = hh.householderQ();
    R = hh.matrixQR().triangularView<Upper>();

But when I take a look (via cout) at Q and R they both are exactly the
same as A.
Where is the flaw in this approach?

Thanks,
Sebastian

Attachment: signature.asc
Description: OpenPGP digital signature



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