< Previous
Next >

: Why does it {hurt when I pee, take me so long to derive the mapping of an element of an n-dimensional array to an element of a one-dimensional array}? It's not difficult, yet I must needs fill up a whole page with poorly drawn diagrams and equations to figure it out.

BTW, if i1...in are the indices of the array element, and sk is the size of dimension k in the array, than the mapping is:

a[i1, i2, ... in] = b[i1 + E{j=2..n}(ij * T{k=1..j-1}(sk))]

The E and T are symbolic of summation and multiplication summation (I forgot the term, but it's the pi summation as opposed to the sigma summation), respectively. Damn these non-MathML-supporting browsers.

Now I need to use this to make my ArrayElementNodes capable of figuring out where in the actual (one-dimensional) array they reference. Then, they will become self-aware and take over the world! AH HA HA HA HA!

Or maybe they will just help me get my compiler done.

[Main] [Edit]

Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.