I've looked at this post which addresses how to loop over arrays that aren't zero-based using the boost::multi_array::origin()
function, but that only creates a single loop.
How does one traverse each dimension of a multi_array
, for example:
for(index i = <origin of dim 1>; ...) {
for(index j = <origin of dim 2>; ...) {
for(index k = <origin of dim 3>; ...) {
myArray[i][j][k] = <something>;
}
}
}
when given an array where both upper and lower bounds are unknown?