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
361 B

  1. #include <iostream>
  2. #include <Eigen/Dense>
  3. using namespace std;
  4. using namespace StormEigen;
  5. int main()
  6. {
  7. Matrix2f A, b;
  8. A << 2, -1, -1, 3;
  9. b << 1, 2, 3, 1;
  10. cout << "Here is the matrix A:\n" << A << endl;
  11. cout << "Here is the right hand side b:\n" << b << endl;
  12. Matrix2f x = A.ldlt().solve(b);
  13. cout << "The solution is:\n" << x << endl;
  14. }