FftOperations.RFFT_WithoutChecks doesn't use input
Closed this issue · 2 comments
RFFT_WithoutChecks(Span<System.Numerics.Complex> destination, Span<System.Numerics.Complex> input)
only uses the length of the input parameter, and not the data inside. The ForwardReal method calling this method apparently isn't tested.
I am curious about the ForwardReal methods. Are they supposed to be identical in output to the corresponding numpy methods? I ask because the the numpy.fft.rfft method states "If the input a contains an imaginary part, it is silently discarded." Secondly, the purpose of rfft seems to be increased efficiency, because it uses a different algorithm to avoid calculating the portion thrown out.
Hi @FrankHileman, thanks for raising this issue!
Let's take a closer look at the code under discussion:
FftSharp/src/FftSharp/FftOperations.cs
Lines 86 to 101 in 6f4c322
The ForwardReal method calling this method apparently isn't tested.
Thanks for pointing that out! I'll start by adding this test now, then follow-up.
The ForwardReal method calling this method apparently isn't tested.
It turns out one overload was tested but not the other. I added testing to both and fixed the issue in #78. I'm merging now and will release an updated package in the next few hours.
Thanks again for reporting this! I'm happy it has been fixed 🚀