From 26129229ec12961687b0414c40e10e2880beec79 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Fri, 15 Oct 2010 09:44:43 -0400 Subject: doc updates/improvements --- doc/examples/TutorialLinAlgSVDSolve.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/examples/TutorialLinAlgSVDSolve.cpp (limited to 'doc/examples/TutorialLinAlgSVDSolve.cpp') diff --git a/doc/examples/TutorialLinAlgSVDSolve.cpp b/doc/examples/TutorialLinAlgSVDSolve.cpp new file mode 100644 index 000000000..c75779d5f --- /dev/null +++ b/doc/examples/TutorialLinAlgSVDSolve.cpp @@ -0,0 +1,15 @@ +#include +#include + +using namespace std; +using namespace Eigen; + +int main() +{ + MatrixXf A = MatrixXf::Random(3, 2); + cout << "Here is the matrix A:\n" << A << endl; + VectorXf b = VectorXf::Random(3); + cout << "Here is the right hand side b:\n" << b << endl; + JacobiSVD svd(A, ComputeThinU | ComputeThinV); + cout << "The least-squares solution is:\n" << svd.solve(b) << endl; +} -- cgit v1.2.3