source: pacpussensors/trunk/Vislab/lib3dv/eigen/Eigen-install/doc/snippets/compile_Vectorwise_reverse.cpp@ 136

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

Doc

File size: 709 bytes
Line 
1#include <Eigen/Dense>
2#include <iostream>
3
4using namespace Eigen;
5using namespace std;
6
7int main(int, char**)
8{
9 cout.precision(3);
10 MatrixXi m = MatrixXi::Random(3,4);
11cout << "Here is the matrix m:" << endl << m << endl;
12cout << "Here is the rowwise reverse of m:" << endl << m.rowwise().reverse() << endl;
13cout << "Here is the colwise reverse of m:" << endl << m.colwise().reverse() << endl;
14
15cout << "Here is the coefficient (1,0) in the rowise reverse of m:" << endl
16<< m.rowwise().reverse()(1,0) << endl;
17cout << "Let us overwrite this coefficient with the value 4." << endl;
18//m.colwise().reverse()(1,0) = 4;
19cout << "Now the matrix m is:" << endl << m << endl;
20
21 return 0;
22}
Note: See TracBrowser for help on using the repository browser.