COSC-4P80-Assignment-2/lib/eigen-3.4.0/doc/snippets/Matrix_resize_int.cpp

7 lines
235 B
C++
Raw Normal View History

2024-10-21 16:42:03 -04:00
VectorXd v(10);
v.resize(3);
RowVector3d w;
w.resize(3); // this is legal, but has no effect
cout << "v: " << v.rows() << " rows, " << v.cols() << " cols" << endl;
cout << "w: " << w.rows() << " rows, " << w.cols() << " cols" << endl;