COSC-4P80-Assignment-2/lib/eigen-3.4.0/doc/snippets/HessenbergDecomposition_mat...

9 lines
391 B
C++
Raw Permalink Normal View History

2024-10-21 16:42:03 -04:00
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;