get rid of using namespace Eigen in sample code

This commit is contained in:
Erik Schultheis
2021-12-07 19:57:38 +00:00
committed by Rasmus Munk Larsen
parent e4c40b092a
commit 39a6aff16c
58 changed files with 274 additions and 399 deletions

View File

@@ -1,16 +1,13 @@
#include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2d A;
Eigen::Matrix2d A;
A << 2, 1,
2, 0.9999999999;
FullPivLU<Matrix2d> lu(A);
cout << "By default, the rank of A is found to be " << lu.rank() << endl;
Eigen::FullPivLU<Eigen::Matrix2d> lu(A);
std::cout << "By default, the rank of A is found to be " << lu.rank() << std::endl;
lu.setThreshold(1e-5);
cout << "With threshold 1e-5, the rank of A is found to be " << lu.rank() << endl;
std::cout << "With threshold 1e-5, the rank of A is found to be " << lu.rank() << std::endl;
}