source:
pacpussensors/trunk/Vislab/lib3dv/eigen/doc/examples/function_taking_eigenbase.cpp@
136
Last change on this file since 136 was 136, checked in by , 7 years ago | |
---|---|
File size: 418 bytes |
Rev | Line | |
---|---|---|
[136] | 1 | #include <iostream> |
2 | #include <Eigen/Core> | |
3 | using namespace Eigen; | |
4 | ||
5 | template <typename Derived> | |
6 | void print_size(const EigenBase<Derived>& b) | |
7 | { | |
8 | std::cout << "size (rows, cols): " << b.size() << " (" << b.rows() | |
9 | << ", " << b.cols() << ")" << std::endl; | |
10 | } | |
11 | ||
12 | int main() | |
13 | { | |
14 | Vector3f v; | |
15 | print_size(v); | |
16 | // v.asDiagonal() returns a 3x3 diagonal matrix pseudo-expression | |
17 | print_size(v.asDiagonal()); | |
18 | } |
Note:
See TracBrowser
for help on using the repository browser.