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.

15 lines
375 B

  1. #include <unsupported/Eigen/MatrixFunctions>
  2. #include <iostream>
  3. using namespace Eigen;
  4. int main()
  5. {
  6. using std::sqrt;
  7. MatrixXd A(3,3);
  8. A << 0.5*sqrt(2), -0.5*sqrt(2), 0,
  9. 0.5*sqrt(2), 0.5*sqrt(2), 0,
  10. 0, 0, 1;
  11. std::cout << "The matrix A is:\n" << A << "\n\n";
  12. std::cout << "The matrix logarithm of A is:\n" << A.log() << "\n";
  13. }