Matthias Pospiech wrote:
> In FFT one usually needs to ****ft/cycle the values in an array.
> Typically the entries are ****fted in the way:
> 012 345 to 345 012
>
> The following code does this, but I wonder if there are possibilites
> to optimize it? It is very generall, but the ****fting with the
> delimiter in the middle is the only one that I need.
You might consider using swap N/2 times, in place, instead of
allocating another array and doing so many loops:
for (int i = 0, half = N/2; i < half; ++i)
swap(A[i], A[i + half]);
Now, you didn't say what should happen if the array has an odd
number of elements, so please adjust the loop accordingly.
> [..]
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


|