[A complimentary Cc of this posting was sent to
A. Sinan Unur
<>], who wrote in article <Xns9795CB63AB7DAasu1cornelledu@127.0.0.1>:
> You need to work a little on explaining the problem and algorithm.
> Neither the code snippet above nor your verbal description makes any
> sense to me
I'm afraid the problem is on your side. The explanation-by-code looks
absolutely clear to me.
Looks like there is a multi-dimensional array of unknown-in-advance
dimension. It is known that it is "rectangular"; the sizes are stored
in another vector (one size per dimension).
One wants a CONVENIENT way to run through the elements of this array.
One hint to OP: since you do not know the dimension at compile
time, you cannot be sure that the index of 1st,2nd,3rd etc
dimensions is $k, $l, $m etc. So the only solution is to have the
running index to be an array too: $I[0], $I[1], $I[3] etc.
This more or less immediately suggests a possible solution...
Hope this helps,
Ilya
P.S. One could also use Math:

ari's forvec(); might be a little bit
heavy-weight solution, but maybe then you will find some use for
other functions in Math:

ari too.