Sunday, July 12, 2009

C++ vector array?

How do i change from a 2d vector array into a 3d form? I actually have some data in the following 2d format which need some transformation...





Example:


a1 b1 c11 c12 c13 c14


a1 b2 c21 c22 c23 c24


a1 b3 c31 c32 c33 c34


a2 b1 d11 d12 d13 d14


a2 b2 d21 d22 d23 d24


a2 b3 d31 d32 d33 d34





In the 3d form (array[x][y][z]) , i will first read a1 into x, b1 into y and each row's Cs into z, after which repeat till b2 and b3 are read in, then move on to read a2 into x, b1 into y and each row's Ds into z. Again, reading till the Cs of b2 and b3 are read in.





Sorry for sounding a bit confusing but I'm already trying my best to explain. Any valuable input will be appreciated. Thanks!!

C++ vector array?
From your description, you are trying to fit c11 AND c12 And c13 AND c14 into ONE variable - z in the array.





It's Not Going To Work!





Either attenuate your data, or use an array with 5 variables (dimensions).


No comments:

Post a Comment