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 | Tridiagonalization<MatrixXf> tri;
|
---|
11 | MatrixXf X = MatrixXf::Random(4,4);
|
---|
12 | MatrixXf A = X + X.transpose();
|
---|
13 | tri.compute(A);
|
---|
14 | cout << "The matrix T in the tridiagonal decomposition of A is: " << endl;
|
---|
15 | cout << tri.matrixT() << endl;
|
---|
16 | tri.compute(2*A); // re-use tri to compute eigenvalues of 2A
|
---|
17 | cout << "The matrix T in the tridiagonal decomposition of 2A is: " << endl;
|
---|
18 | cout << tri.matrixT() << endl;
|
---|
19 |
|
---|
20 | return 0;
|
---|
21 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.