aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/Triangular_solve.cpp
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2015-05-01 22:10:41 +0200
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2015-05-01 22:10:41 +0200
commit28a4c92cbff88c75b932ce0d091ccaa2b6010724 (patch)
tree75eb0f8005954c5049f050e45bfcb2d8173c5671 /doc/snippets/Triangular_solve.cpp
parent173b34e9abd06202d3df8ba07686b874115956b7 (diff)
bug #998: Started fixing doxygen warnings
Diffstat (limited to 'doc/snippets/Triangular_solve.cpp')
-rw-r--r--doc/snippets/Triangular_solve.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/snippets/Triangular_solve.cpp b/doc/snippets/Triangular_solve.cpp
new file mode 100644
index 000000000..548442467
--- /dev/null
+++ b/doc/snippets/Triangular_solve.cpp
@@ -0,0 +1,11 @@
+Matrix3d m = Matrix3d::Zero();
+m.triangularView<Eigen::Upper>().setOnes();
+cout << "Here is the matrix m:\n" << m << endl;
+Matrix3d n = Matrix3d::Ones();
+n.triangularView<Eigen::Lower>() *= 2;
+cout << "Here is the matrix n:\n" << n << endl;
+cout << "And now here is m.inverse()*n, taking advantage of the fact that"
+ " m is upper-triangular:\n"
+ << m.triangularView<Eigen::Upper>().solve(n) << endl;
+cout << "And this is n*m.inverse():\n"
+ << m.triangularView<Eigen::Upper>().solve<Eigen::OnTheRight>(n);