xref: /aosp_15_r20/external/eigen/doc/snippets/HessenbergDecomposition_matrixH.cpp (revision bf2c37156dfe67e5dfebd6d394bad8b2ab5804d4)
1*bf2c3715SXin Li Matrix4f A = MatrixXf::Random(4,4);
2*bf2c3715SXin Li cout << "Here is a random 4x4 matrix:" << endl << A << endl;
3*bf2c3715SXin Li HessenbergDecomposition<MatrixXf> hessOfA(A);
4*bf2c3715SXin Li MatrixXf H = hessOfA.matrixH();
5*bf2c3715SXin Li cout << "The Hessenberg matrix H is:" << endl << H << endl;
6*bf2c3715SXin Li MatrixXf Q = hessOfA.matrixQ();
7*bf2c3715SXin Li cout << "The orthogonal matrix Q is:" << endl << Q << endl;
8*bf2c3715SXin Li cout << "Q H Q^T is:" << endl << Q * H * Q.transpose() << endl;
9