Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
You can flatten the loop to a 1D affair by taking the address of the first element of the 3D array and then do 128*5*9 iterations.Today's optimizing compilers might do the same and in that case this technique would not yield any speed advantage. On the other hand, it's worth a try.
With nv3's suggested 'flat approach', using pointers I obtained a somewhat surprising result (about 3x speed improvement):register int i, j, k; LARGE_INTEGER t[4]; QueryPerformanceCounter(&t[0]); //-> 3 loops for (i=0; i<128; i++) { for (j=0; j<5; j++) { ...
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.