function_taking_eigenbase.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <Eigen/Core>
3 
4 template <typename Derived>
6 {
7  std::cout << "size (rows, cols): " << b.size() << " (" << b.rows()
8  << ", " << b.cols() << ")" << std::endl;
9 }
10 
11 int main()
12 {
14  print_size(v);
15  // v.asDiagonal() returns a 3x3 diagonal matrix pseudo-expression
16  print_size(v.asDiagonal());
17 }
Array< int, Dynamic, 1 > v
Array< int, 3, 1 > b
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
void print_size(const Eigen::EigenBase< Derived > &b)