00001 EigenSolver<MatrixXf> es; 00002 MatrixXf A = MatrixXf::Random(4,4); 00003 es.compute(A, /* computeEigenvectors = */ false); 00004 cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl; 00005 es.compute(A + MatrixXf::Identity(4,4), false); // re-use es to compute eigenvalues of A+I 00006 cout << "The eigenvalues of A+I are: " << es.eigenvalues().transpose() << endl;