tut_arithmetic_matrix_mul.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 #include <Eigen/Dense>
00003 
00004 using namespace Eigen;
00005 int main()
00006 {
00007   Matrix2d mat;
00008   mat << 1, 2,
00009          3, 4;
00010   Vector2d u(-1,1), v(2,0);
00011   std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
00012   std::cout << "Here is mat*u:\n" << mat*u << std::endl;
00013   std::cout << "Here is u^T*mat:\n" << u.transpose()*mat << std::endl;
00014   std::cout << "Here is u^T*v:\n" << u.transpose()*v << std::endl;
00015   std::cout << "Here is u*v^T:\n" << u*v.transpose() << std::endl;
00016   std::cout << "Let's multiply mat by itself" << std::endl;
00017   mat = mat*mat;
00018   std::cout << "Now mat is mat:\n" << mat << std::endl;
00019 }


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