mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
8 lines
362 B
C++
8 lines
362 B
C++
|
SelfAdjointEigenSolver<Matrix4f> es;
|
||
|
Matrix4f X = Matrix4f::Random(4,4);
|
||
|
Matrix4f A = X + X.transpose();
|
||
|
es.compute(A);
|
||
|
cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl;
|
||
|
es.compute(A + Matrix4f::Identity(4,4)); // re-use es to compute eigenvalues of A+I
|
||
|
cout << "The eigenvalues of A+I are: " << es.eigenvalues().transpose() << endl;
|