tut_arithmetic_add_sub.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 #include <Eigen/Dense>
00003 
00004 using namespace Eigen;
00005 
00006 int main()
00007 {
00008   Matrix2d a;
00009   a << 1, 2,
00010        3, 4;
00011   MatrixXd b(2,2);
00012   b << 2, 3,
00013        1, 4;
00014   std::cout << "a + b =\n" << a + b << std::endl;
00015   std::cout << "a - b =\n" << a - b << std::endl;
00016   std::cout << "Doing a += b;" << std::endl;
00017   a += b;
00018   std::cout << "Now a =\n" << a << std::endl;
00019   Vector3d v(1,2,3);
00020   Vector3d w(1,0,0);
00021   std::cout << "-v + w - v =\n" << -v + w - v << std::endl;
00022 }


libicr
Author(s): Robert Krug
autogenerated on Mon Jan 6 2014 11:33:55