source: pacpussensors/trunk/Vislab/lib3dv/eigen/doc/examples/tut_arithmetic_matrix_mul.cpp@ 136

Last change on this file since 136 was 136, checked in by ldecherf, 7 years ago

Doc

File size: 612 bytes
Line 
1#include <iostream>
2#include <Eigen/Dense>
3
4using namespace Eigen;
5int main()
6{
7 Matrix2d mat;
8 mat << 1, 2,
9 3, 4;
10 Vector2d u(-1,1), v(2,0);
11 std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
12 std::cout << "Here is mat*u:\n" << mat*u << std::endl;
13 std::cout << "Here is u^T*mat:\n" << u.transpose()*mat << std::endl;
14 std::cout << "Here is u^T*v:\n" << u.transpose()*v << std::endl;
15 std::cout << "Here is u*v^T:\n" << u*v.transpose() << std::endl;
16 std::cout << "Let's multiply mat by itself" << std::endl;
17 mat = mat*mat;
18 std::cout << "Now mat is mat:\n" << mat << std::endl;
19}
Note: See TracBrowser for help on using the repository browser.