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/TutorialLinAlgSetThreshold.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 eigen/doc/examples/TutorialLinAlgSetThreshold.cpp (limited to 'eigen/doc/examples/TutorialLinAlgSetThreshold.cpp') diff --git a/eigen/doc/examples/TutorialLinAlgSetThreshold.cpp b/eigen/doc/examples/TutorialLinAlgSetThreshold.cpp new file mode 100644 index 0000000..3956b13 --- /dev/null +++ b/eigen/doc/examples/TutorialLinAlgSetThreshold.cpp @@ -0,0 +1,16 @@ +#include +#include + +using namespace std; +using namespace Eigen; + +int main() +{ + Matrix2d A; + A << 2, 1, + 2, 0.9999999999; + FullPivLU lu(A); + cout << "By default, the rank of A is found to be " << lu.rank() << endl; + lu.setThreshold(1e-5); + cout << "With threshold 1e-5, the rank of A is found to be " << lu.rank() << endl; +} -- cgit v1.2.3