Line | |
---|
1 | #include <Eigen/Dense>
|
---|
2 | #include <iostream>
|
---|
3 |
|
---|
4 | using namespace Eigen;
|
---|
5 | using namespace std;
|
---|
6 |
|
---|
7 | int main(int, char**)
|
---|
8 | {
|
---|
9 | cout.precision(3);
|
---|
10 | MatrixXf A(MatrixXf::Random(5,3)), thinQ(MatrixXf::Identity(5,3)), Q;
|
---|
11 | A.setRandom();
|
---|
12 | HouseholderQR<MatrixXf> qr(A);
|
---|
13 | Q = qr.householderQ();
|
---|
14 | thinQ = qr.householderQ() * thinQ;
|
---|
15 | std::cout << "The complete unitary matrix Q is:\n" << Q << "\n\n";
|
---|
16 | std::cout << "The thin matrix Q is:\n" << thinQ << "\n\n";
|
---|
17 |
|
---|
18 | return 0;
|
---|
19 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.