source:
pacpussensors/trunk/Vislab/lib3dv/eigen/doc/examples/Tutorial_BlockOperations_print_block.cpp@
138
Last change on this file since 138 was 136, checked in by , 8 years ago | |
---|---|
File size: 413 bytes |
Line | |
---|---|
1 | #include <Eigen/Dense> |
2 | #include <iostream> |
3 | |
4 | using namespace std; |
5 | |
6 | int main() |
7 | { |
8 | Eigen::MatrixXf m(4,4); |
9 | m << 1, 2, 3, 4, |
10 | 5, 6, 7, 8, |
11 | 9,10,11,12, |
12 | 13,14,15,16; |
13 | cout << "Block in the middle" << endl; |
14 | cout << m.block<2,2>(1,1) << endl << endl; |
15 | for (int i = 1; i <= 3; ++i) |
16 | { |
17 | cout << "Block of size " << i << "x" << i << endl; |
18 | cout << m.block(0,0,i,i) << endl << endl; |
19 | } |
20 | } |
Note:
See TracBrowser
for help on using the repository browser.