tut_matrix_resize.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <Eigen/Dense>
3 
4 using namespace Eigen;
5 
6 int main()
7 {
8  MatrixXd m(2,5);
9  m.resize(4,3);
10  std::cout << "The matrix m is of size "
11  << m.rows() << "x" << m.cols() << std::endl;
12  std::cout << "It has " << m.size() << " coefficients" << std::endl;
13  VectorXd v(2);
14  v.resize(5);
15  std::cout << "The vector v is of size " << v.size() << std::endl;
16  std::cout << "As a matrix, v is of size "
17  << v.rows() << "x" << v.cols() << std::endl;
18 }
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
main
int main()
Definition: tut_matrix_resize.cpp:6
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1


gtsam
Author(s):
autogenerated on Tue Jun 25 2024 03:07:51