How can I declare a 3d array(like arrays nested in arrays which are in turn nested in arrays) with blitz++? Say the dimensions are 3,4,5. Also how would I access said array elements? Could you also tell me how to get the size of each dimension of this multi dimensional array? like for c++ vectors there are oneDvec.size(), twoDvec.size() or twoDvec[di].size() etc.
Asked
Active
Viewed 482 times
0
-
General Reference: http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list – Armen Tsirunyan Apr 08 '13 at 20:06
-
Thank you for the list. Needed it. – amy Apr 09 '13 at 04:25
2 Answers
1
// declare
blitz::Array<double, 3> blitzArray( 3, 4, 5 );
// access
blitzArray(0,0,0) = 1.0001;

Öö Tiib
- 10,809
- 25
- 44
-
Thank you Oo. Could you also tell me how to get the size of each dimension of this multi dimensional array? like for c++ vectors there are oneDvec.size(), twoDvec.size() or twoDvec[di].size() etc. – amy Apr 09 '13 at 09:58
-
Could it be blitzArray.extent(0), blitzArray.extent(1) and blitzArray.extent(2) for 1D, 2D and 3D array size respectively? – amy Apr 09 '13 at 10:12
1
Yes, it is blitzArray.extent(0), blitzArray.extent(1) and blitzArray.extent(2) for 1D, 2D and 3D array size respectively.

amy
- 33
- 7