aboutsummaryrefslogtreecommitdiff
path: root/doc/snippets/HessenbergDecomposition_packedMatrix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/snippets/HessenbergDecomposition_packedMatrix.cpp')
-rw-r--r--doc/snippets/HessenbergDecomposition_packedMatrix.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/snippets/HessenbergDecomposition_packedMatrix.cpp b/doc/snippets/HessenbergDecomposition_packedMatrix.cpp
new file mode 100644
index 000000000..4fa5957e8
--- /dev/null
+++ b/doc/snippets/HessenbergDecomposition_packedMatrix.cpp
@@ -0,0 +1,9 @@
+Matrix4d A = Matrix4d::Random(4,4);
+cout << "Here is a random 4x4 matrix:" << endl << A << endl;
+HessenbergDecomposition<Matrix4d> hessOfA(A);
+Matrix4d pm = hessOfA.packedMatrix();
+cout << "The packed matrix M is:" << endl << pm << endl;
+cout << "The upper Hessenberg part corresponds to the matrix H, which is:"
+ << endl << hessOfA.matrixH() << endl;
+Vector3d hc = hessOfA.householderCoefficients();
+cout << "The vector of Householder coefficients is:" << endl << hc << endl;