You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
377 B

  1. #include <iostream>
  2. #include <Eigen/Dense>
  3. using namespace std;
  4. using namespace Eigen;
  5. int main()
  6. {
  7. Matrix2d A;
  8. A << 2, 1,
  9. 2, 0.9999999999;
  10. FullPivLU<Matrix2d> lu(A);
  11. cout << "By default, the rank of A is found to be " << lu.rank() << endl;
  12. lu.setThreshold(1e-5);
  13. cout << "With threshold 1e-5, the rank of A is found to be " << lu.rank() << endl;
  14. }