Autocorrelation function with ranges
kerdemdemir via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Jun 27 09:24:54 PDT 2015
On Saturday, 27 June 2015 at 12:17:31 UTC, Timon Gehr wrote:
>
> This computes a²·a̅ instead of a·a̅.
>
> What is the source code for residualPowerOf2?
>
>> Also is there any performance issues? can I make this faster?
>>
>
> Probably you should use
> http://dlang.org/phobos/std_complex.html#.sqAbs instead. You
> then also don't need the final map to extract the real part.
You are absulately right instead
fftResult.zip(fftResult.map!(a => a * a.conj()))
I corrected it to
fftResult.zip(fftResult.map!(a => a.conj()))
Thanks a lot
More information about the Digitalmars-d-learn
mailing list