source: pacpussensors/trunk/Vislab/lib3dv/eigen/doc/examples/tut_matrix_resize.cpp@ 136

Last change on this file since 136 was 136, checked in by ldecherf, 7 years ago

Doc

File size: 489 bytes
Line 
1#include <iostream>
2#include <Eigen/Dense>
3
4using namespace Eigen;
5
6int 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}
Note: See TracBrowser for help on using the repository browser.