Is there a way to initialize a vector of vectors in the same ,quick, manner as you initialize a matrix?
typedef int type;
type matrix[2][2]=
{
{1,0},{0,1}
std::vector> vector_of_vectors;
then if you want to add, you can use this procedure:
vector_of_vectors.resize(#rows); //just changed the number of rows in the vector
vector_of_vectors[row#].push_back(someInt); //this adds a column
Or you can do something like this:
std::vector myRow;
myRow.push_back(someInt);
vector_of_vectors.push_back(myRow);
So, in your case, you should be able to say:
vector_of_vectors.resize(2);
vector_of_vectors[0].resize(2);
vector_of_vectors[1].resize(2);
for(int i=0; i < 2; i++)
for(int j=0; j < 2; j++)
vector_of_vectors[i][j] = yourInt;