From 44861dcbfeee041223c4aac1ee075e92fa4daa01 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 18 Sep 2016 12:42:15 +0200 Subject: update --- eigen/doc/examples/TutorialLinAlgExSolveLDLT.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 eigen/doc/examples/TutorialLinAlgExSolveLDLT.cpp (limited to 'eigen/doc/examples/TutorialLinAlgExSolveLDLT.cpp') diff --git a/eigen/doc/examples/TutorialLinAlgExSolveLDLT.cpp b/eigen/doc/examples/TutorialLinAlgExSolveLDLT.cpp new file mode 100644 index 0000000..f8beacd --- /dev/null +++ b/eigen/doc/examples/TutorialLinAlgExSolveLDLT.cpp @@ -0,0 +1,16 @@ +#include +#include + +using namespace std; +using namespace Eigen; + +int main() +{ + Matrix2f A, b; + A << 2, -1, -1, 3; + b << 1, 2, 3, 1; + cout << "Here is the matrix A:\n" << A << endl; + cout << "Here is the right hand side b:\n" << b << endl; + Matrix2f x = A.ldlt().solve(b); + cout << "The solution is:\n" << x << endl; +} -- cgit v1.2.3