Matrix_resize_int_int.cpp revision c981c48f5bc9aefeffc0bcb0cc3934c2fae179dd
1ea285162342df160e7860e26528bc7110bc6c0cdShih-wei LiaoMatrixXd m(2,3);
2ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaom << 1,2,3,4,5,6;
3ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaocout << "here's the 2x3 matrix m:" << endl << m << endl;
4ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaocout << "let's resize m to 3x2. This is a conservative resizing because 2*3==3*2." << endl;
5ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaom.resize(3,2);
6ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaocout << "here's the 3x2 matrix m:" << endl << m << endl;
7ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaocout << "now let's resize m to size 2x2. This is NOT a conservative resizing, so it becomes uninitialized:" << endl;
8m.resize(2,2);
9cout << m << endl;
10