1*bf2c3715SXin Li EigenSolver<MatrixXf> es; 2*bf2c3715SXin Li MatrixXf A = MatrixXf::Random(4,4); 3*bf2c3715SXin Li es.compute(A, /* computeEigenvectors = */ false); 4*bf2c3715SXin Li cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl; 5*bf2c3715SXin Li es.compute(A + MatrixXf::Identity(4,4), false); // re-use es to compute eigenvalues of A+I 6*bf2c3715SXin Li cout << "The eigenvalues of A+I are: " << es.eigenvalues().transpose() << endl; 7