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

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

Doc

File size: 706 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 Matrix<int, 3, 4, ColMajor> Acolmajor;
11Acolmajor << 8, 2, 2, 9,
12 9, 1, 4, 4,
13 3, 5, 4, 5;
14cout << "The matrix A:" << endl;
15cout << Acolmajor << endl << endl;
16
17cout << "In memory (column-major):" << endl;
18for (int i = 0; i < Acolmajor.size(); i++)
19 cout << *(Acolmajor.data() + i) << " ";
20cout << endl << endl;
21
22Matrix<int, 3, 4, RowMajor> Arowmajor = Acolmajor;
23cout << "In memory (row-major):" << endl;
24for (int i = 0; i < Arowmajor.size(); i++)
25 cout << *(Arowmajor.data() + i) << " ";
26cout << endl;
27
28
29 return 0;
30}
Note: See TracBrowser for help on using the repository browser.