aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/Tutorial_solve_triangular.cpp
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2009-08-22 20:12:47 +0100
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2009-08-22 20:12:47 +0100
commit90735b6a9cc4c91eb41ef1d2b6828f15a7f4fba3 (patch)
treef466895074e2e67fa734fe975da6fe6a984b37db /doc/snippets/Tutorial_solve_triangular.cpp
parent37dede6077250156be084e55e629c68535456d2a (diff)
Rewrite tutorial section on solving linear systems
Diffstat (limited to 'doc/snippets/Tutorial_solve_triangular.cpp')
-rw-r--r--doc/snippets/Tutorial_solve_triangular.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/snippets/Tutorial_solve_triangular.cpp b/doc/snippets/Tutorial_solve_triangular.cpp
new file mode 100644
index 000000000..ff876f687
--- /dev/null
+++ b/doc/snippets/Tutorial_solve_triangular.cpp
@@ -0,0 +1,8 @@
+Matrix3f A;
+Vector3f b;
+A << 1,2,3, 0,5,6, 0,0,10;
+b << 3, 3, 4;
+cout << "Here is the matrix A:" << endl << A << endl;
+cout << "Here is the vector b:" << endl << b << endl;
+Vector3f x = A.triangularView<UpperTriangular>().solve(b);
+cout << "The solution is:" << endl << x << endl;