diff options
Diffstat (limited to 'eigen/doc/snippets/Tutorial_solve_triangular.cpp')
-rw-r--r-- | eigen/doc/snippets/Tutorial_solve_triangular.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/eigen/doc/snippets/Tutorial_solve_triangular.cpp b/eigen/doc/snippets/Tutorial_solve_triangular.cpp new file mode 100644 index 0000000..9d13f22 --- /dev/null +++ b/eigen/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<Upper>().solve(b); +cout << "The solution is:" << endl << x << endl; |