2023-12-06 05:22:55 +08:00
|
|
|
MatrixXd A = MatrixXd::Random(6, 6);
|
2010-03-31 18:59:11 +08:00
|
|
|
cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
|
|
|
|
|
|
|
|
|
|
EigenSolver<MatrixXd> es(A);
|
|
|
|
|
MatrixXd D = es.pseudoEigenvalueMatrix();
|
|
|
|
|
MatrixXd V = es.pseudoEigenvectors();
|
|
|
|
|
cout << "The pseudo-eigenvalue matrix D is:" << endl << D << endl;
|
|
|
|
|
cout << "The pseudo-eigenvector matrix V is:" << endl << V << endl;
|
|
|
|
|
cout << "Finally, V * D * V^(-1) = " << endl << V * D * V.inverse() << endl;
|