Hello, I would like to use a 3-d Vector to store and add values between some calculations in c++. I'm having problems adding the third dimension to my vector. What I would like to achieve is a vector that for each iteration puts in a 2-D vector and here only the first values for each vector... So The input would look something like this
1 3 7 9
- - - -
Then Later on I would like to add values to the places marked with - so in the end the matrix would look something like this(for every iteration)(only 2-d shown...)
1 3 7 9
2 5 7
3 2
1
Right now I'm having trouble adding the first elements to it. And i'm using the sollist 3-D vector as a global vector. My values array all have the same amount of elements that are > 0.5 so that's not where the error is.
vector<vector<vector<int>>>sollist;
void sol(array& values, int& iter)
{int i;
sollist.push_back ( vector<vector<int>>() );
for (i=0;i<10;i++)
if (values[i]>0.5)
sollist[iter][0].push_back(i);
}
Thank you very much for any help and for an excellent forum... /Buxley