P99
|
◆ P99_CDIM
Compute an absolute index in a multidimensional array in the same way as C. If we have size_t NAME[N];
that hold the side lengths of an size_t const D[] = { 3, 4, 7 };
corresponds to a cube of side length 3 in dimension 0, 4 in dimension 1 and 7 in dimension 2, with in total 84 elements. With that, we get P99_CDIM(D, 1, 2, 3) => ((3) + ((D)[2] * ((2) + ((D)[1] * (1)))))
P99_CDIM(D, k0, k1, k2) => ((k2) + ((D)[2] * ((k1) + ((D)[1] * (k0)))))
|