xref: /aosp_15_r20/external/eigen/doc/snippets/GeneralizedEigenSolver.cpp (revision bf2c37156dfe67e5dfebd6d394bad8b2ab5804d4)
1*bf2c3715SXin Li GeneralizedEigenSolver<MatrixXf> ges;
2*bf2c3715SXin Li MatrixXf A = MatrixXf::Random(4,4);
3*bf2c3715SXin Li MatrixXf B = MatrixXf::Random(4,4);
4*bf2c3715SXin Li ges.compute(A, B);
5*bf2c3715SXin Li cout << "The (complex) numerators of the generalzied eigenvalues are: " << ges.alphas().transpose() << endl;
6*bf2c3715SXin Li cout << "The (real) denominatore of the generalzied eigenvalues are: " << ges.betas().transpose() << endl;
7*bf2c3715SXin Li cout << "The (complex) generalzied eigenvalues are (alphas./beta): " << ges.eigenvalues().transpose() << endl;
8