aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp
blob: 07c92a1e4f0366f3998d36fb807cfa2add7b7d1a (plain)
1
2
3
4
5
6
7
8
9
MatrixXd X = MatrixXd::Random(5,5);
MatrixXd A = X * X.transpose();
X = MatrixXd::Random(5,5);
MatrixXd B = X * X.transpose();

GeneralizedSelfAdjointEigenSolver<MatrixXd> es(A,B,EigenvaluesOnly);
cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl;
es.compute(B,A,false);
cout << "The eigenvalues of the pencil (B,A) are:" << endl << es.eigenvalues() << endl;