aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/class_FullPivLU.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-11-16 17:05:12 -0500
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-11-16 17:05:12 -0500
commitb90744dc053d176f3ae00f67fbaac7f3b083b55e (patch)
treed2b7f049337f60f8385eaa6de0e3f2fe242db533 /doc/snippets/class_FullPivLU.cpp
parent76c614f9bd8e80a530a4aa685f1ae7506b64b8dd (diff)
Port FullPivLU to PermutationMatrix
Diffstat (limited to 'doc/snippets/class_FullPivLU.cpp')
-rw-r--r--doc/snippets/class_FullPivLU.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/doc/snippets/class_FullPivLU.cpp b/doc/snippets/class_FullPivLU.cpp
index 40d76e8e6..855782d15 100644
--- a/doc/snippets/class_FullPivLU.cpp
+++ b/doc/snippets/class_FullPivLU.cpp
@@ -13,8 +13,4 @@ cout << "Here is the U part:" << endl;
Matrix5x3 u = lu.matrixLU().part<UpperTriangular>();
cout << u << endl;
cout << "Let us now reconstruct the original matrix m:" << endl;
-Matrix5x3 x = l * u;
-Matrix5x3 y;
-for(int i = 0; i < 5; i++) for(int j = 0; j < 3; j++)
- y(i, lu.permutationQ()[j]) = x(lu.permutationP()[i], j);
-cout << y << endl; // should be equal to the original matrix m
+cout << lu.permutationP().inverse() * l * u * lu.permutationQ().inverse() << endl;