1 #include <iostream>
2 #include <Eigen/Dense>
3 
4 using namespace Eigen;
5 
main()6 int main()
7 {
8   Matrix2d a;
9   a << 1, 2,
10        3, 4;
11   MatrixXd b(2,2);
12   b << 2, 3,
13        1, 4;
14   std::cout << "a + b =\n" << a + b << std::endl;
15   std::cout << "a - b =\n" << a - b << std::endl;
16   std::cout << "Doing a += b;" << std::endl;
17   a += b;
18   std::cout << "Now a =\n" << a << std::endl;
19   Vector3d v(1,2,3);
20   Vector3d w(1,0,0);
21   std::cout << "-v + w - v =\n" << -v + w - v << std::endl;
22 }
23