Define a 3 dimensions vector
Hi,
to create a matrix I do;
|
vector<vector<double> > matrix( cols , vector<double>( lines ) );
| |
Now I need to create a 3 dimensional vector, I tried
|
vector<vector<vector<double> > > matrix_mod_phase1( cols , vector<double>( lines ), vector<vector<double>( lines ));
| |
but this does not work...
Someone know how do to create this...
vector<vector<double> /* missing '>' here*/( lines ))
But I'm not sure that's a valid constructor.
I'd do this:
1 2 3 4 5 6 7
|
vector<vector<vector<double> > > matrix_mod_phase1;
matrix_mod_phase1.resize(width);
for (int a=0;a<width;a++){
matrix_mod_phase1[a].resize(height);
for (int b=0;b<height;b++)
matrix_mod_phase1[a][b].resize(depth);
}
| |
Last edited on
Topic archived. No new replies allowed.