function_taking_eigenbase.cpp File Reference

Go to the source code of this file.

Functions

int main ()
 
template<typename Derived >
void print_size (const Eigen::EigenBase< Derived > &b)
 

Function Documentation

◆ main()

int main ( )

Definition at line 11 of file function_taking_eigenbase.cpp.

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
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
void print_size(const Eigen::EigenBase< Derived > &b)

◆ print_size()

template<typename Derived >
void print_size ( const Eigen::EigenBase< Derived > &  b)

Definition at line 5 of file function_taking_eigenbase.cpp.

6 {
7  std::cout << "size (rows, cols): " << b.size() << " (" << b.rows()
8  << ", " << b.cols() << ")" << std::endl;
9 }
Array< int, 3, 1 > b