tut_matrix_resize.cpp File Reference

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 4 of file tut_matrix_resize.cpp.

5 {
6  Eigen::MatrixXd m(2,5);
7  m.resize(4,3);
8  std::cout << "The matrix m is of size "
9  << m.rows() << "x" << m.cols() << std::endl;
10  std::cout << "It has " << m.size() << " coefficients" << std::endl;
11  Eigen::VectorXd v(2);
12  v.resize(5);
13  std::cout << "The vector v is of size " << v.size() << std::endl;
14  std::cout << "As a matrix, v is of size "
15  << v.rows() << "x" << v.cols() << std::endl;
16 }
Matrix3f m
Array< int, Dynamic, 1 > v
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182