My name is Bob and I am a three-star programmer. Well, more accurately, I'm trying not to be. I have read a lot on the internet and this site about how "three-star programmer" is a Very Bad Thing. And I can see why. I have read very little (very little that's comprehensible, anyway) about how to avoid it. I mean, there are data sets out there that simply need three or more indices to access their values in a sane manner. So how do I deal with such a set?
I remember seeing a C macro a while back that allows you to store such a data set in a 1D array, and then access the data with three indices, something to the effect of a(i,j,k)
is expanded to a[i*NZ*NY + j*NZ +k]
but I can't remember how to write it and can't find it on the internet. Anyone know, or have a better idea?