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.

19 lines
622 B

  1. #include <iostream>
  2. #include <StormEigen/Dense>
  3. using namespace StormEigen;
  4. int main()
  5. {
  6. Matrix2d mat;
  7. mat << 1, 2,
  8. 3, 4;
  9. Vector2d u(-1,1), v(2,0);
  10. std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
  11. std::cout << "Here is mat*u:\n" << mat*u << std::endl;
  12. std::cout << "Here is u^T*mat:\n" << u.transpose()*mat << std::endl;
  13. std::cout << "Here is u^T*v:\n" << u.transpose()*v << std::endl;
  14. std::cout << "Here is u*v^T:\n" << u*v.transpose() << std::endl;
  15. std::cout << "Let's multiply mat by itself" << std::endl;
  16. mat = mat*mat;
  17. std::cout << "Now mat is mat:\n" << mat << std::endl;
  18. }