I'm converting C++ code to C# code, it happens to be the Fast Fourier Transform on an image in the Frequency Domain. Just to give some context.
Here is a link to the C++ Code : fft.cc
I have this function called Step, its signature is this in C++:
void step ( int n, int mj, float a[], float b[], float c[], float d[], float w[], float sgn );
and is called like this:
step ( n, mj, &x[0*2+0], &x[(n/2)*2+0], &y[0*2+0], &y[mj*2+0], w, sgn );
I want to convert it to C#, now this function operates on either Y or X arrays depending on whether its a Forward Fast Fourier Transform or a Backward Fast Fourier Transform. (More context)
What I don't understand, is that in C#, doing x[0*2+0] does nothing.... firstly putting an integer in the square brackets actually calls for a variable at a position in that array.
But what is it doing in C++, I know that the & is equiv to the ref C# keyword, it is saying get the contents from the array that is being pointed too, but I feel that in this context it means more than just that.
So how would you call that function in C#, obviously this fails:
step(n, mj, x[0 * 2 + 0], x[(n / 2) * 2 + 0], y[0 * 2 + 0], y[mj * 2 + 0], w, sgn);