source: pacpussensors/trunk/Vislab/lib3dv/eigen/Eigen-install/doc/snippets/compile_EigenSolver_pseudoEigenvectors.cpp@ 136

Last change on this file since 136 was 136, checked in by ldecherf, 7 years ago

Doc

File size: 602 bytes
Line 
1#include <Eigen/Dense>
2#include <iostream>
3
4using namespace Eigen;
5using namespace std;
6
7int main(int, char**)
8{
9 cout.precision(3);
10 MatrixXd A = MatrixXd::Random(6,6);
11cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
12
13EigenSolver<MatrixXd> es(A);
14MatrixXd D = es.pseudoEigenvalueMatrix();
15MatrixXd V = es.pseudoEigenvectors();
16cout << "The pseudo-eigenvalue matrix D is:" << endl << D << endl;
17cout << "The pseudo-eigenvector matrix V is:" << endl << V << endl;
18cout << "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.