You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
418 B

  1. #include <iostream>
  2. #include <Eigen/Core>
  3. using namespace Eigen;
  4. template <typename Derived>
  5. void print_size(const EigenBase<Derived>& b)
  6. {
  7. std::cout << "size (rows, cols): " << b.size() << " (" << b.rows()
  8. << ", " << b.cols() << ")" << std::endl;
  9. }
  10. int main()
  11. {
  12. Vector3f v;
  13. print_size(v);
  14. // v.asDiagonal() returns a 3x3 diagonal matrix pseudo-expression
  15. print_size(v.asDiagonal());
  16. }