tut_matrix_resize.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <Eigen/Dense>
3 
4 int main()
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
int main()