From 90735b6a9cc4c91eb41ef1d2b6828f15a7f4fba3 Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Sat, 22 Aug 2009 20:12:47 +0100 Subject: Rewrite tutorial section on solving linear systems --- doc/snippets/Tutorial_solve_singular.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/snippets/Tutorial_solve_singular.cpp (limited to 'doc/snippets/Tutorial_solve_singular.cpp') 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; -- cgit v1.2.3