aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/HessenbergDecomposition_matrixH.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/snippets/HessenbergDecomposition_matrixH.cpp')
-rw-r--r--doc/snippets/HessenbergDecomposition_matrixH.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/snippets/HessenbergDecomposition_matrixH.cpp b/doc/snippets/HessenbergDecomposition_matrixH.cpp
new file mode 100644
index 000000000..af0136668
--- /dev/null
+++ b/doc/snippets/HessenbergDecomposition_matrixH.cpp
@@ -0,0 +1,8 @@
+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;