Rev | Line | |
---|
[136] | 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 | MatrixXd A = MatrixXd::Random(6,6);
|
---|
| 11 | cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
|
---|
| 12 |
|
---|
| 13 | EigenSolver<MatrixXd> es(A);
|
---|
| 14 | MatrixXd D = es.pseudoEigenvalueMatrix();
|
---|
| 15 | MatrixXd V = es.pseudoEigenvectors();
|
---|
| 16 | cout << "The pseudo-eigenvalue matrix D is:" << endl << D << endl;
|
---|
| 17 | cout << "The pseudo-eigenvector matrix V is:" << endl << V << endl;
|
---|
| 18 | cout << "Finally, V * D * V^(-1) = " << endl << V * D * V.inverse() << endl;
|
---|
| 19 |
|
---|
| 20 | return 0;
|
---|
| 21 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.