mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-15 07:10:37 +08:00
9 lines
391 B
C++
9 lines
391 B
C++
Matrix4f A = MatrixXf::Random(4,4);
|
|
cout << "Here is a random 4x4 matrix:" << endl << A << endl;
|
|
HessenbergDecomposition<MatrixXf> hessOfA(A);
|
|
MatrixXf H = hessOfA.matrixH();
|
|
cout << "The Hessenberg matrix H is:" << endl << H << endl;
|
|
MatrixXf Q = hessOfA.matrixQ();
|
|
cout << "The orthogonal matrix Q is:" << endl << Q << endl;
|
|
cout << "Q H Q^T is:" << endl << Q * H * Q.transpose() << endl;
|