00001 #include <iostream> 00002 #include <Eigen/Core> 00003 using namespace Eigen; 00004 00005 template <typename Derived> 00006 void print_size(const EigenBase<Derived>& b) 00007 { 00008 std::cout << "size (rows, cols): " << b.size() << " (" << b.rows() 00009 << ", " << b.cols() << ")" << std::endl; 00010 } 00011 00012 int main() 00013 { 00014 Vector3f v; 00015 print_size(v); 00016 // v.asDiagonal() returns a 3x3 diagonal matrix pseudo-expression 00017 print_size(v.asDiagonal()); 00018 }