summaryrefslogtreecommitdiffhomepage
path: root/eigen/doc/snippets/FullPivLU_image.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'eigen/doc/snippets/FullPivLU_image.cpp')
-rw-r--r--eigen/doc/snippets/FullPivLU_image.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/eigen/doc/snippets/FullPivLU_image.cpp b/eigen/doc/snippets/FullPivLU_image.cpp
new file mode 100644
index 0000000..817bc1e
--- /dev/null
+++ b/eigen/doc/snippets/FullPivLU_image.cpp
@@ -0,0 +1,9 @@
+Matrix3d m;
+m << 1,1,0,
+ 1,3,2,
+ 0,1,1;
+cout << "Here is the matrix m:" << endl << m << endl;
+cout << "Notice that the middle column is the sum of the two others, so the "
+ << "columns are linearly dependent." << endl;
+cout << "Here is a matrix whose columns have the same span but are linearly independent:"
+ << endl << m.fullPivLu().image(m) << endl;