xref: /aosp_15_r20/external/eigen/doc/snippets/HouseholderQR_householderQ.cpp (revision bf2c37156dfe67e5dfebd6d394bad8b2ab5804d4)
1*bf2c3715SXin Li MatrixXf A(MatrixXf::Random(5,3)), thinQ(MatrixXf::Identity(5,3)), Q;
2*bf2c3715SXin Li A.setRandom();
3*bf2c3715SXin Li HouseholderQR<MatrixXf> qr(A);
4*bf2c3715SXin Li Q = qr.householderQ();
5*bf2c3715SXin Li thinQ = qr.householderQ() * thinQ;
6*bf2c3715SXin Li std::cout << "The complete unitary matrix Q is:\n" << Q << "\n\n";
7*bf2c3715SXin Li std::cout << "The thin matrix Q is:\n" << thinQ << "\n\n";
8