aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/Tutorial_solve_singular.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_singular.cpp
parent37dede6077250156be084e55e629c68535456d2a (diff)
Rewrite tutorial section on solving linear systems
Diffstat (limited to 'doc/snippets/Tutorial_solve_singular.cpp')
-rw-r--r--doc/snippets/Tutorial_solve_singular.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/snippets/Tutorial_solve_singular.cpp b/doc/snippets/Tutorial_solve_singular.cpp
new file mode 100644
index 000000000..da94ad445
--- /dev/null
+++ b/doc/snippets/Tutorial_solve_singular.cpp
@@ -0,0 +1,9 @@
+Matrix3f A;
+Vector3f b;
+A << 1,2,3, 4,5,6, 7,8,9;
+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.partialLu().solve(b, &x);
+cout << "The solution is:" << endl << x << endl;