blob: 1652463f90398ec266a015bcc7dc5797eeb0e09d [file] [log] [blame]
EigenSolver<MatrixXf> es;
MatrixXf A = MatrixXf::Random(4, 4);
es.compute(A, /* computeEigenvectors = */ false);
cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl;
es.compute(A + MatrixXf::Identity(4, 4), false); // re-use es to compute eigenvalues of A+I
cout << "The eigenvalues of A+I are: " << es.eigenvalues().transpose() << endl;