문제

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.

도움이 되었습니까?

해결책

// declare
blitz::Array<double, 3> blitzArray( 3, 4, 5 );
// access
blitzArray(0,0,0) = 1.0001;

다른 팁

Yes, it is blitzArray.extent(0), blitzArray.extent(1) and blitzArray.extent(2) for 1D, 2D and 3D array size respectively.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top