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

  1. #include <unsupported/Eigen/MatrixFunctions>
  2. #include <iostream>
  3. using namespace Eigen;
  4. int main()
  5. {
  6. const double pi = std::acos(-1.0);
  7. MatrixXd A(3,3);
  8. A << 0, -pi/4, 0,
  9. pi/4, 0, 0,
  10. 0, 0, 0;
  11. std::cout << "The matrix A is:\n" << A << "\n\n";
  12. std::cout << "The matrix exponential of A is:\n" << A.exp() << "\n\n";
  13. }