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 X = MatrixXd::Random(5,5);
|
---|
| 11 | MatrixXd A = X * X.transpose();
|
---|
| 12 | X = MatrixXd::Random(5,5);
|
---|
| 13 | MatrixXd B = X * X.transpose();
|
---|
| 14 |
|
---|
| 15 | GeneralizedSelfAdjointEigenSolver<MatrixXd> es(A,B,EigenvaluesOnly);
|
---|
| 16 | cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl;
|
---|
| 17 | es.compute(B,A,false);
|
---|
| 18 | cout << "The eigenvalues of the pencil (B,A) are:" << endl << es.eigenvalues() << endl;
|
---|
| 19 |
|
---|
| 20 | return 0;
|
---|
| 21 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.