std::vector<std::vector<double>> M;
//Make M a 3x3 matrix with the first row all 1's,
//the second row all 2's and the third row all 3's
M.push_back(std::vector<double>(3, 1.0));
M.push_back(std::vector<double>(3, 2.0));
M.push_back(std::vector<double>(3, 3.0));
std::vector<std::vector<double>> Jagged;
//Make Jagged a jagged 2D array with the
//Jagged[0] being an array of size 3,
//Jagged[1] an array of size 7, and Jagged[2]
//an array of size 10
Jagged.push_back(std::vector<double>(3));
Jagged.push_back(std::vector<double>(7));
Jagged.push_back(std::vector<double>(10));
No, Jagged is a set of three vectors, with the first vector having length 3, the second vector having length 7, and the third vector having length 10. The point of my example was to show that std::vector<std::vector<double> > x;can be thought of as a Matrix in the MxN collection of numbers sense, but it could also be something else (as in a jagged 2D array which doesn't fit the "Matrix" requirement).